Commit 47e75ad0 authored by cinwell.li's avatar cinwell.li Committed by FuryBean

Fix overwritten warn in Vue 2.1.8, fixed #2040 (#2047)

* Fix overwritten warn in Vue 2.1.8, fixed #2040

* Fix dropdown-menu

* Fix placement again

* fix test
parent ea9e5ed4
...@@ -202,7 +202,6 @@ export default { ...@@ -202,7 +202,6 @@ export default {
default: 'left' default: 'left'
}, },
value: {}, value: {},
haveTrigger: {},
pickerOptions: {} pickerOptions: {}
}, },
......
...@@ -26,9 +26,9 @@ ...@@ -26,9 +26,9 @@
this.referenceElm = this.$parent.$el; this.referenceElm = this.$parent.$el;
}, },
computed: { watch: {
placement() { '$parent.menuAlign'(val) {
return `bottom-${this.$parent.menuAlign}`; this.currentPlacement = `bottom-${val}`;
} }
} }
}; };
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
return { return {
classMap: {}, classMap: {},
colorMap: {}, colorMap: {},
classes: null,
pointerAtLeftHalf: false, pointerAtLeftHalf: false,
currentValue: this.value, currentValue: this.value,
hoverIndex: -1 hoverIndex: -1
......
...@@ -46,7 +46,8 @@ export default { ...@@ -46,7 +46,8 @@ export default {
data() { data() {
return { return {
showPopper: false showPopper: false,
currentPlacement: ''
}; };
}, },
...@@ -68,7 +69,8 @@ export default { ...@@ -68,7 +69,8 @@ export default {
methods: { methods: {
createPopper() { createPopper() {
if (this.$isServer) return; if (this.$isServer) return;
if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.placement)) { this.currentPlacement = this.currentPlacement || this.placement;
if (!/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement)) {
return; return;
} }
...@@ -88,7 +90,7 @@ export default { ...@@ -88,7 +90,7 @@ export default {
this.popperJS.destroy(); this.popperJS.destroy();
} }
options.placement = this.placement; options.placement = this.currentPlacement;
options.offset = this.offset; options.offset = this.offset;
this.popperJS = new PopperJS(reference, popper, options); this.popperJS = new PopperJS(reference, popper, options);
this.popperJS.onCreate(_ => { this.popperJS.onCreate(_ => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment