基于 vue 2.6 是 H5应用的 简单ui组件库。
npm install vue-app-components --save
- [x] 全局 api 实现Toast
- [ ] 全局 api 实现Dialog
- [ ] 仿 APP 横向 Tab 标签页
在项目的 main.js
中使用 Vue.use()
注册组件
import appComponents from 'vue-app-components'
import 'vue-app-components/lib/vue-app-components.css'
Vue.use(appComponents)
然后再所需要的view页面中可以直接通过 this.$vaToast(msg, options)
来调用。其中的 options
是非必须参数。
this.$vaToast('这是通过vue-app-components组件的toast', {
position: '50vh'
});
参数说明
prop | value | remark |
---|---|---|
position | 'bottom'(default)/ 'top'/ 'middle'/ '50vh'/ '50px' |
用于控制toast在屏幕的位置。 如果自定义距离, 则是相对于屏幕顶部的位置 |
TODO