feat(Style): add multi-line ellipsis classes (#4690)

This commit is contained in:
neverland
2019-10-11 14:48:02 +08:00
committed by GitHub
parent a47122ce19
commit 79322ea892
7 changed files with 44 additions and 15 deletions
+15 -6
View File
@@ -1,7 +1,8 @@
<template>
<demo-section>
<demo-block :title="$t('ellipsis')">
<div class="van-ellipsis">{{ $t('text') }}</div>
<div class="van-ellipsis">{{ $t('text1') }}</div>
<div class="van-multi-ellipsis--l2">{{ $t('text2') }}</div>
</demo-block>
<demo-block :title="$t('hairline')">
@@ -53,14 +54,16 @@ export default {
ellipsis: '文字省略',
animation: '动画',
toggle: '切换动画',
text: '这是一段宽度限制 250px 的文字,后面的内容会省略'
text1: '这是一段最多显示一行的文字,后面的内容会省略',
text2: '这是一段最多显示两行的文字,后面的内容会省略。这是一段最多显示两行的文字,后面的内容会省略'
},
'en-US': {
hairline: 'Hairline',
ellipsis: 'Text Ellipsis',
animation: 'Animation',
toggle: 'Switch animation',
text: 'This is a paragraph of 250px width limit, the back will be omitted.'
text1: 'This is a paragraph that displays up to one line of text, and the rest of the text will be omitted.',
text2: 'This is a paragraph that displays up to two lines of text, and the rest of the text will be omitted.'
}
},
@@ -88,10 +91,16 @@ export default {
@import '../../style/var';
.demo-style {
.van-ellipsis {
max-width: 250px;
.van-ellipsis,
.van-multi-ellipsis--l2 {
max-width: 300px;
margin-left: @padding-md;
font-size: 13px;
font-size: 14px;
line-height: 18px;
}
.van-ellipsis {
margin-bottom: @padding-md;
}
.van-hairline--top {