You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
633 B
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

const refreshComponentMixin = {
data () {
return {
updateKey: 0
}
},
computed: {
Data () {
return JSON.parse(JSON.stringify(this.config))
}
},
watch: {
Data: {
handler (newVal, oldVal) {
this.$nextTick(() => {
if ((newVal.w !== oldVal.w) || (newVal.h !== oldVal.h)) {
this.updateKey = new Date().getTime()
}
})
},
deep: true
}
},
methods: {
// 由于静态组件没有混入公共函数所以需要定义一个changeStyle方法以免报错
changeStyle () {
}
}
}
export { refreshComponentMixin }