diff --git a/examples/routers/switch.vue b/examples/routers/switch.vue
index 8bc5f268..dfc4fe93 100644
--- a/examples/routers/switch.vue
+++ b/examples/routers/switch.vue
@@ -1,6 +1,6 @@
-
+
开
关
@@ -32,6 +32,7 @@
+
@@ -42,12 +43,26 @@
m1: true,
disabled: true,
loading: false,
- switch1 : true
+ switch1: true
}
},
methods: {
change (status) {
console.log(status)
+ },
+ beforeChange () {
+ return new Promise((resolve, reject) => {
+ this.$Modal.confirm({
+ title: '切换确认',
+ content: '您确认要切换开关状态吗?',
+ onOk: () => {
+ resolve();
+ },
+ onCancel: () => {
+ reject();
+ }
+ });
+ });
}
}
}
diff --git a/src/components/switch/switch.vue b/src/components/switch/switch.vue
index 4ae936e0..a523d488 100644
--- a/src/components/switch/switch.vue
+++ b/src/components/switch/switch.vue
@@ -16,9 +16,7 @@