# plugin

将一些模块封装为 vue 插件,如 notice 模块,方便项目中调用。

# notice

# 初始化

Vue.use(bekit.plugin.vueNotice[, options]);

  • 参数:
    • {Object} options
# options
属性 描述 默认值 是否必填
toast 提供给 toast 方法的默认 option {}
alert 提供给 alert 方法的默认 option {}
confirm 提供给 confirm 方法的默认 option {}
prompt 提供给 prompt 方法的默认 option {}
messageBox 提供给 messageBox 方法的默认 option {}

# 示例

import Vue from 'vue';
import * as bekit from 'bekit';
Vue.use(bekit.plugin.vueNotice, {
    toast: {
        iconClass: 'xxicon'
    }
});

# 方法

# this.$toast
# this.$messageBox
# this.$alert
# this.$confirm
# this.$prompt

# 示例

this.$toast('message');
this.$alert('message', 'title').then(function() {
    // do something here
});
this.$confirm('message', 'title').then(function() {
    // confirm here
}).catch(function() {
    // cancel here
});
Last Updated: 2020/8/3上午3:52:20