vtip.js是一款基于vue的消息提示框插件。
(下载的附件附有DEMO)
参数说明
const options = {
title: '这里是标题',
content: '显示内容',
theme: 'dark',
// tip 的容器,在不设置的情况下,tip 会自动在参考元素的父级元素上面查找合适的容器,但推荐手动设置一个 tip 对象容器
container: document.body,
customProps: { msg: '自定义渲染' },
// 这里通过 customComponent 定义了一个自定义组件
customComponent: Vue.extend({
props: ['msg'],
render (h) {
return h('span', this.msg)
}
}),
placements: ['top', 'buttom'],
duration: 400,
transition: true
...
}
GitHub 地址 :https://github.com/kinglisky/vtip