Browse Source

Merge branch 'v2' of https://github.com/jdf2e/nutui into v2

zhenyulei 5 years ago
parent
commit
efca3d869d
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/packages/range/range.vue

+ 10 - 2
src/packages/range/range.vue

@@ -104,6 +104,11 @@ export default {
 			ani: false
     };
   },
+  watch: {
+    range() {
+      this.init();
+    }
+  },
   computed: {
     total() {
       return this.range[1] - this.range[0];
@@ -122,6 +127,10 @@ export default {
 		}
   },
   methods: {
+    init() {
+      this.box = this.$el.querySelector(".nut-range-box");
+      this.propInit();
+    },
 		updateRangeValues() {
 			let rangeValues = this.currentLeft > this.currentRight? [this.currentRight, this.currentLeft]: [this.currentLeft, this.currentRight];
 			this.$emit("update:rangeValues", rangeValues);
@@ -180,8 +189,7 @@ export default {
   },
   mounted() {
     this.$nextTick(() => {
-      this.box = this.$el.querySelector(".nut-range-box");
-      this.propInit();
+      this.init();
     });
   }
 };