fix: 修复复用存量视图未清理历史选择框的问题

This commit is contained in:
wangjiahao 2022-05-25 14:51:15 +08:00
parent 929d1f64e2
commit e176d364c6
2 changed files with 11 additions and 5 deletions

View File

@ -208,9 +208,11 @@ export default {
handleClick() { handleClick() {
const events = this.config.events const events = this.config.events
Object.keys(events).forEach(event => { if (events) {
this[event](events[event]) Object.keys(events).forEach(event => {
}) this[event](events[event])
})
}
}, },
elementMouseDown(e) { elementMouseDown(e) {
// private // private

View File

@ -75,18 +75,22 @@ export default {
}) })
}) })
} else if (params.showType === 'view') { } else if (params.showType === 'view') {
_this.componentData = []
const componentId = uuid.v1() const componentId = uuid.v1()
_this.canvasStyleData = deepCopy(DEFAULT_COMMON_CANVAS_STYLE_STRING) _this.canvasStyleData = deepCopy(DEFAULT_COMMON_CANVAS_STYLE_STRING)
const userView = { const userView = {
... deepCopy(USER_VIEW), ... deepCopy(USER_VIEW),
'id': componentId } 'id': componentId,
'auxiliaryMatrix': false }
userView.style.width = _this.canvasStyleData.width userView.style.width = _this.canvasStyleData.width
userView.style.height = _this.canvasStyleData.height userView.style.height = _this.canvasStyleData.height
userView['propValue'] = { userView['propValue'] = {
'viewId': params.showId, 'viewId': params.showId,
'id': componentId 'id': componentId
} }
_this.componentData.push(userView) _this.$nextTick(() => {
_this.componentData.push(userView)
})
} }
} }
} }