监听store中的数值变化,需要用到计算属性,然后watch调用resize方法
computed: {data() {//左侧菜单状态发生变化return this.$store.state.app.sidebar.opened}},watch: {data(n, m) {//重置宽高this.resizeFun()}},mounted() {//屏幕大小发生变化window.addEventListener('resize', () => {this.resizeFun()})},methods: {//重置宽高resizeFun() {//此处引用的第三方插件,需要监听容器宽高变化,随之调用resize方法setTimeout(() => {this.$refs.XXX.resize()//你的逻辑}, 200)}}