Skip to content

Commit 3af1df8

Browse files
committed
upd: 添加confirm
1 parent 0edf0cc commit 3af1df8

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

vues/examples/components/vux/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import AlertPlugin from 'vux/src/plugins/alert/index.js';
3131
// import Clocker from 'vux/src/components/clocker/index.vue';
3232
// import ColorPicker from 'vux/src/components/color-picker/index.vue';
3333
// import Confirm from 'vux/src/components/confirm/index.vue';
34-
// import ConfirmPlugin from 'vux/src/plugins/confirm/index.js';
34+
import ConfirmPlugin from 'vux/src/plugins/confirm/index.js';
3535
// import cookie from 'vux/src/tools/cookie/index.js';
3636
// import Countdown from 'vux/src/components/countdown/index.vue';
3737
import Countup from 'vux/src/components/countup/index.vue';
@@ -280,6 +280,7 @@ const install = function (Vue) {
280280
});
281281

282282
Vue.use(AlertPlugin);
283+
Vue.use(ConfirmPlugin);
283284
Vue.use(ToastPlugin);
284285
Vue.prototype.$space = space;
285286

vues/examples/pages/vux.vue

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export default {
6767
title: 'hello',
6868
onShow () {
6969
_this.$info('alert show')
70+
_this.showConfirm()
7071
},
7172
onHide () {
7273
_this.$error('alert hide')
@@ -76,6 +77,18 @@ export default {
7677
}
7778
})
7879
})
80+
},
81+
showConfirm () {
82+
const _this = this
83+
this.$vux.confirm.show({
84+
title: 'Hello',
85+
content: 'World !',
86+
confirmText: 'Yes',
87+
cancelText: 'No',
88+
onConfirm () {
89+
_this.$info('confirm !')
90+
}
91+
})
7992
}
8093
}
8194
}

0 commit comments

Comments
 (0)