Vue获取动态样式的宽度
用vue 获取动态元素的宽度1.等到所有节点加载完成要放在this.nextTick里面。∗∗∗∗2.要使用nextTick里面。** **2.要使用nextTick里面。∗∗∗∗2.要使用el挂载此元素el-input refcompanyStyle/el-inputnewAddBtn(){ let _this this; this.$nextTick(function () { _this.inputStyWidth _this.$refs.companyStyle.$el.clientWidth px; }

相关新闻