v title
1.0.0
Vue 的工具提示文本。
网上例子:https://yujinpan.github.io/v-title
现在新版本 2.0 发布了,删除了必需的包
element-ui
和tooltip.js
,tooltip.js 已经被弃用,新版本的tippy.js
增加了更多功能,所以v-title
删除了很多 dom 句柄。
npm install --save v-title
import Vue from 'vue' ;
import VTitle from 'v-title' ;
Vue . use ( VTitle ) ;
import VTitle from 'v-title' ;
export default {
directives : {
VTitle
}
} ;
line-height > offsetHeight
) String
位置上/右/下/左(-start,-end),默认:顶部Number
显示延迟时间,默认:'200'Number
工具提示最大宽度,默认值:无< template >
< p v-title = " title " >hover me!</ p >
<!-- modify: light -->
< p v-title.light = " title " >hover me!</ p >
<!-- modify: delay -->
< p v-title.delay = " title " >hover me!</ p >
<!-- attr: title-delay-time -->
< p v-title.delay = " title " title-delay-time = " 1000 " >hover me!</ p >
<!-- attr: title-max-width -->
< p v-title = " title " title-max-width = " 100 " >hover me!</ p >
<!-- modify: overflow -->
< p v-title.overflow = " title " >hover me!</ p >
<!-- modify: overflow.multiple -->
< p v-title.overflow.multiple = " title " >hover me!</ p >
<!-- attr: title-placement -->
< p v-title = " title " title-placement = " bottom " >
top(-start, -end), right(-start, -end), bottom(-start, -end),
left(-start, -end),default: top
</ p >
</ template >
< script >
import VTitle from ' v-title ' ;
export default {
directives : {
VTitle
},
data () {
return {
title : ' ABCDEFGABCDEFGABCDEFGABCDEFGABCDEFGABCDEFG ' ,
};
}
};
</ script >
< style lang="scss">
// custom className
.tippy-content {
font-size : 20 px ;
}
</ style >