欧美亚洲中文,在线国自产视频,欧洲一区在线观看视频,亚洲综合中文字幕在线观看

      1. <dfn id="rfwes"></dfn>
          <object id="rfwes"></object>
        1. 站長(zhǎng)資訊網(wǎng)
          最全最豐富的資訊網(wǎng)站

          vue.js怎么改變樣式

          vue.js改變樣式的方法:首先給元素定義ref屬性;然后通過(guò)js方法修改元素的樣式,代碼為【'background-color:#1F2429;width:66px'】;最后修改單一樣式時(shí)可直接使用樣式名稱。

          vue.js怎么改變樣式

          【相關(guān)文章推薦:vue.js】

          • 該方法適用于所有品牌電腦

          vue.js改變樣式的方法:

          1、給元素定義ref屬性

           <el-button ref="btnClick" class="list_button" " @click="openClose"></el-button>

          2、通過(guò)js 方法修改元素的樣式 修改較多樣式時(shí)可使用cssText

          function openClose() {         this.isCollapse = !this.isCollapse           if (this.isCollapse) {             this.$refs.btnClick.$el.style.cssText =                 'background-color:#1F2429;width:66px';                     } else {             this.$refs.btnClick.$el.style.cssText =                 'background-color:#1F2429;width:140px';         }     }

          3、修改單一樣式時(shí)可直接使用樣式名稱

          function openClose() {         this.isCollapse = !this.isCollapse           if (this.isCollapse) {             this.$refs.btnClick.$el.style.color = 'red';                     } else {             this.$refs.btnClick.$el.style.color = 'blue';         }     }

          相關(guān)學(xué)習(xí)推薦:javascript學(xué)習(xí)教程

          贊(0)
          分享到: 更多 (0)
          網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)