Poptip add prop wordWrap
This commit is contained in:
parent
953d02c723
commit
130ed8894b
3 changed files with 19 additions and 2 deletions
|
@ -7,7 +7,7 @@
|
||||||
<Button @click="handleChange">change</Button>
|
<Button @click="handleChange">change</Button>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Button @click="handleChange">change</Button>
|
<Button @click="handleChange">change</Button>
|
||||||
<Poptip title="Title" transfer width="250" content="我的文本超级无敌长我的文本超级无敌长我的文本超级无敌长我的文本超级无敌长我的文本超级无敌长我的文本超级无敌长">
|
<Poptip title="Title" transfer width="250" word-wrap content="我的文本超级,无敌,长我的文本超级无敌长我的文本超级无敌长我的文本超级无敌长我的文本超级无敌长我的文本超级无敌长">
|
||||||
<Button>Click</Button>
|
<Button>Click</Button>
|
||||||
</Poptip>
|
</Poptip>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
<div :class="[prefixCls + '-inner']" v-if="!confirm">
|
<div :class="[prefixCls + '-inner']" v-if="!confirm">
|
||||||
<div :class="[prefixCls + '-title']" v-if="showTitle" ref="title"><slot name="title"><div :class="[prefixCls + '-title-inner']">{{ title }}</div></slot></div>
|
<div :class="[prefixCls + '-title']" v-if="showTitle" ref="title"><slot name="title"><div :class="[prefixCls + '-title-inner']">{{ title }}</div></slot></div>
|
||||||
<div :class="[prefixCls + '-body']">
|
<div :class="[prefixCls + '-body']">
|
||||||
<div :class="[prefixCls + '-body-content']"><slot name="content"><div :class="[prefixCls + '-body-content-inner']">{{ content }}</div></slot></div>
|
<div :class="contentClasses"><slot name="content"><div :class="[prefixCls + '-body-content-inner']">{{ content }}</div></slot></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -100,6 +100,10 @@
|
||||||
},
|
},
|
||||||
popperClass: {
|
popperClass: {
|
||||||
type: String
|
type: String
|
||||||
|
},
|
||||||
|
wordWrap: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
|
@ -149,6 +153,14 @@
|
||||||
} else {
|
} else {
|
||||||
return this.cancelText;
|
return this.cancelText;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
contentClasses () {
|
||||||
|
return [
|
||||||
|
`${prefixCls}-body-content`,
|
||||||
|
{
|
||||||
|
[`${prefixCls}-body-content-word-wrap`]: this.wordWrap
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -43,6 +43,11 @@
|
||||||
&-content{
|
&-content{
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
|
&-word-wrap{
|
||||||
|
white-space: pre-wrap;
|
||||||
|
text-align: justify;
|
||||||
|
}
|
||||||
|
|
||||||
&-inner{
|
&-inner{
|
||||||
color: @text-color;
|
color: @text-color;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue