Auxiliary text display(like el-tooltip
).
https://yujinpan.github.io/v-title/
npm install --save v-title
If your project does not use element-ui, you need to introduce a separate element-ui package, like this:
import 'v-title/lib/element-ui';
import Vue from 'vue';
import VTitle from 'v-title';
Vue.use(VTitle);
import VTitle from 'v-title';
export default {
components: {
VTitle
}
};
- delay(modifier): show delay
- light(modifier): use light effect, default use dark
- overflow(modifier): use overflow mode
- multiple(modifier): use multiple line mode(need set element's
line-height > offsetHeight
) - title-placement(attribute): tooltip placement
<template>
<p v-title="title"></p>
<p v-title.delay="title"></p>
<p v-title.light="title"></p>
<p v-title.overflow="title"></p>
<p v-title.overflow.multiple="title"></p>
<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: 'test',
};
}
};
</script>