Browse Source

编辑器-switcher组件value prop不做类型校验

(cherry picked from commit df4bcc02bc96df81dd8ccc3214f2bda9b5aaf626)
任一存 3 years ago
parent
commit
da7bf7f19d
1 changed files with 4 additions and 2 deletions
  1. 4 2
      packages/qjkankan-editor/src/components/shared/Switcher.vue

+ 4 - 2
packages/qjkankan-editor/src/components/shared/Switcher.vue

@@ -8,7 +8,9 @@ export default {
     name: "com-switcher",
     props: {
         name: String,
-        value: Number,
+        value: {
+          required: true,
+        },
         disable: Boolean
     },
     // data() {
@@ -20,7 +22,7 @@ export default {
         onClick() {
             this.$emit("change", Number(!this.value), this.name);
         }
-    }
+    },
 };
 </script>
 <style lang="less" scoped>