久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<i id='5muYW'><tr id='5muYW'><dt id='5muYW'><q id='5muYW'><span id='5muYW'><b id='5muYW'><form id='5muYW'><ins id='5muYW'></ins><ul id='5muYW'></ul><sub id='5muYW'></sub></form><legend id='5muYW'></legend><bdo id='5muYW'><pre id='5muYW'><center id='5muYW'></center></pre></bdo></b><th id='5muYW'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5muYW'><tfoot id='5muYW'></tfoot><dl id='5muYW'><fieldset id='5muYW'></fieldset></dl></div>
        <bdo id='5muYW'></bdo><ul id='5muYW'></ul>
      <tfoot id='5muYW'></tfoot>

    1. <small id='5muYW'></small><noframes id='5muYW'>

    2. <legend id='5muYW'><style id='5muYW'><dir id='5muYW'><q id='5muYW'></q></dir></style></legend>

        如何在角度2中動態(tài)更改css類名

        How to change the css class name dynamically in angular 2(如何在角度2中動態(tài)更改css類名)

        • <small id='DnY7D'></small><noframes id='DnY7D'>

              <tbody id='DnY7D'></tbody>
              <bdo id='DnY7D'></bdo><ul id='DnY7D'></ul>
              <legend id='DnY7D'><style id='DnY7D'><dir id='DnY7D'><q id='DnY7D'></q></dir></style></legend>

              1. <i id='DnY7D'><tr id='DnY7D'><dt id='DnY7D'><q id='DnY7D'><span id='DnY7D'><b id='DnY7D'><form id='DnY7D'><ins id='DnY7D'></ins><ul id='DnY7D'></ul><sub id='DnY7D'></sub></form><legend id='DnY7D'></legend><bdo id='DnY7D'><pre id='DnY7D'><center id='DnY7D'></center></pre></bdo></b><th id='DnY7D'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='DnY7D'><tfoot id='DnY7D'></tfoot><dl id='DnY7D'><fieldset id='DnY7D'></fieldset></dl></div>

                • <tfoot id='DnY7D'></tfoot>
                  本文介紹了如何在角度2中動態(tài)更改css類名的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有兩個CSS類名如下

                  .icon_heart{顏色:#bdbdbd;}.icon_heart_red{顏色:#a6b7d4;;}

                  我的 HTML 有一個心形圖標(biāo)

                  <div class="icon_heart" *ngIf="showheartIcon">

                  這里我有兩個 div 標(biāo)簽,心形圖標(biāo)最初是灰色,點擊后我會將其更改為藍色.

                  這是我的 ts 文件代碼:

                   showheartIcon=true;showheartIconRed =假;setWishlistTrue(id){this.showheartIconRed = true;this.showheartIcon = false;}setWishlistFalse(id){this.showheartIconRed = false;this.showheartIcon = true;}

                  我有兩個不同顏色的圖標(biāo).

                  問題

                  是否可以更改圖標(biāo)的類別而不是兩個心形圖標(biāo)?

                  我在 JavaScript 中看到我們可以更改它w3schools 簡單的方法將類應(yīng)用于 div 標(biāo)簽,但我是 TypeScript 的新手.如何更改班級?

                  解決方案

                  <div [ngClass]="showheartIconRead ? 'icon_heart_red' : 'icon_heart'">

                  I have two CSS class name as follows

                  .icon_heart{
                       color: #bdbdbd;
                  }
                  
                  .icon_heart_red{
                      color:#a6b7d4;;
                  }
                  

                  My HTML has a heart icon

                  <div class="icon_heart" *ngIf="showheartIcon">
                      <ion-icon name="heart" (click)="setWishlistTrue(category.product_id);" class="heart"></ion-icon>
                  </div>
                  <div class="icon_heart_red" *ngIf="showheartIconRed">
                      <ion-icon name="heart" (click)="setWishlistFalse(category.product_id);" class="heart"></ion-icon>
                  </div>
                  

                  Here I have two div tags, the heart icon is of gray color initially and on clicking that I will change it to blue color.

                  Here is my ts file code: showheartIcon=true; showheartIconRed =false; setWishlistTrue(id){ this.showheartIconRed = true; this.showheartIcon = false; } setWishlistFalse(id){ this.showheartIconRed = false; this.showheartIcon = true; } I have two icons of different color. Question Instead of having two heart icons is it possible to change the class of the icon? I have seen in JavaScript we can change it w3schools simple way to apply class to the div tag, but I am new to TypeScript. How can I change the class? 解決方案 <div [class.icon_heart]="!showheartIconRead" [class.icon_heart_red]="showheartIconRead"> or<div [ngClass]="showheartIconRead ? 'icon_heart_red' : 'icon_heart'"> 這篇關(guān)于如何在角度2中動態(tài)更改css類名的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)! 【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                  anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                  Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                  Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態(tài)元素 - Angular 2 amp;離子2)
                  How to reload the ion-page after pop() in ionic2(如何在 ionic2 中的 pop() 之后重新加載離子頁面)
                  Retrieve localstorage value when value is change in Ionic 2(當(dāng) Ionic 2 中的值發(fā)生變化時檢索本地存儲值)

                  1. <tfoot id='QQGXq'></tfoot>
                        <tbody id='QQGXq'></tbody>

                      <small id='QQGXq'></small><noframes id='QQGXq'>

                        • <bdo id='QQGXq'></bdo><ul id='QQGXq'></ul>

                        • <legend id='QQGXq'><style id='QQGXq'><dir id='QQGXq'><q id='QQGXq'></q></dir></style></legend>
                          <i id='QQGXq'><tr id='QQGXq'><dt id='QQGXq'><q id='QQGXq'><span id='QQGXq'><b id='QQGXq'><form id='QQGXq'><ins id='QQGXq'></ins><ul id='QQGXq'></ul><sub id='QQGXq'></sub></form><legend id='QQGXq'></legend><bdo id='QQGXq'><pre id='QQGXq'><center id='QQGXq'></center></pre></bdo></b><th id='QQGXq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='QQGXq'><tfoot id='QQGXq'></tfoot><dl id='QQGXq'><fieldset id='QQGXq'></fieldset></dl></div>

                            主站蜘蛛池模板: 一区二区三区免费看 | 日韩在线视频免费观看 | 日韩精品在线一区 | 一区二区三区四区在线视频 | 免费成人高清 | 日韩中文一区 | 一区二区免费高清视频 | 久久久免费 | 午夜精品一区二区三区在线观看 | 91精品国产综合久久久久 | 久久亚洲一区 | 黄色一级在线播放 | 国产一级大片 | 高清久久| 日本福利在线观看 | 久久久国产亚洲精品 | 久久久噜噜噜久久中文字幕色伊伊 | 久久精品久久久 | 国产成人精品999在线观看 | 成人在线一区二区 | 大久| 成人在线免费观看 | 精品国产一二三区 | 成人午夜影院 | 69亚洲精品 | 国产精品美女 | 国产免费一区二区三区网站免费 | 精品免费视频 | 亚洲图片视频一区 | 极情综合网| 男女一区二区三区 | 精品国产乱码久久久久久中文 | 亚洲成人综合网站 | 亚洲在线免费观看 | 色视频欧美 | 日韩色在线 | 亚洲精品欧美一区二区三区 | 亚洲日本欧美 | 综合九九| 91精品国产91久久久久久最新 | 久久久久九九九女人毛片 |