1.0.17 • Published 2 years ago
vue-dialog-jf v1.0.17
my-popupbox
A Vue.js project
该插件包含了message,tooltip,confirm,dialog应用;
应用该插件,需首先在项目中引入:
import Vue from 'vue' import vDialogJf from '../../node_modules/vue-dialog-jf/index.js' Vue.use(vDialogJf)
message使用方式
this.$v_message({
message:'this is message',
time:5000
})
confirm使用方式
this.$v_confirm({
title:'确认',
width:'300px',
height:'200px',
content:'this is my confirm ',
confirm:function(){},
cancel:function(){}
})
var dia = this.$v_dialog(options);
var dia = this.$v_dialog({
title:'创建账号',
width:'400px',
height:'300px',
multi:false, //多步操作传true
render:test,
appData:{name:that.num,description:'good boy'},
complete:function(data){
//点击确认后的操作
//do somthing;
},
cancel:function(){
//点击取消后的操作
}
});
dialog的render中可包含completeFun方法和cancelFun方法,分别在点击确认和取消时调用,用于处理render组件内部逻辑。
其中,completeFun中返回false则不关闭dialog,否则点击确认后关闭弹出框。
appData中传递的参数,可在render组件中通过props导入。
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
# build for production and view the bundle analyzer report
npm run build --report
For a detailed explanation on how things work, check out the guide and docs for vue-loader.