Installation
$ npm install vue-ui-modal --save
Usage
;
In your webpack configuration
moduleexports = // ... module: rules: test: /\.vue$/ include: // resolve('src'), path use: 'vue-loader' // ...
Plugins(or Methods)
- alert
- confirm
- prompt
- toast
- loading
alert example
; /* * utils.alert * @param {String|Object} msg * @return promise **/ // utils.alert('天亮了');const promise = utils; promise;
confirm example
; /* * utils.confirm * @param {String|Object} msg * @return promise **/ const promise = utils; promise ;
prompt example
; /* * utils.prompt * @param {String|Object} msg * @return promise **/ const promise = utilsprompt title: '提示标题' // 非必填,默认为提示 msg: '谈谈你对最近的工作有啥感受?' leftButtonText: '忽略' rightButtonText: '提交' hideTitle: false // 隐藏标题,默认false; promise ;
toast example
; /* * utils.toast * @param {String|Object} msg * @return vue object **/ // utils.toast('好消息');const vm = utils;// vm.destroy(); // 销毁vue组件
loading example
; /* * utils.loading * @param {String} msg * @return vue object **/ const vm = utils;;