update
This commit is contained in:
@@ -292,21 +292,25 @@ export default {
|
||||
sparepartsProps,
|
||||
sparepartsDatalist,
|
||||
rightSideProps,
|
||||
rightSideDatalist
|
||||
rightSideDatalist,
|
||||
// refreshKey: 0
|
||||
scale: 1
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['sidebar'])
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
// window.addEventListener('resize', () => {
|
||||
// console.log('resizing....')
|
||||
// this.refreshSize++
|
||||
// this.$nextTick(() => {
|
||||
// this.$forceUpdate()
|
||||
// })
|
||||
// }) // 不可行
|
||||
this.$nextTick(() => {
|
||||
this.scale = this.$refs['cockpit-container-equipment'].offsetWidth / 1920
|
||||
this.$refs['cockpit-container-equipment'].style.setProperty('--scale', this.scale)
|
||||
|
||||
this.$watch(() => this.$refs['cockpit-container-equipment'].offsetWidth, function(v, o) {
|
||||
console.log('resize ... ref..')
|
||||
this.scale = this.$refs['cockpit-container-equipment'].offsetWidth / 1920
|
||||
this.$refs['cockpit-container-equipment'].style.setProperty('--scale', this.scale)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user