angular css 双向绑定的坑 IE

    xiaoxiao2021-03-25  106

    三种情况

    1、只用style IE上不起作用

    <div style="background:{{bgColor}}"> This will NOT get colored in IE </div>

    2、用ng-attr-style 兼顾IE

    <div ng-attr-style="background:{{bgColor}}"> But this WILL get colored in IE </div>

    3、用ng-style 此处可以是JSon,可以带条件

    <div ng-style="styleObject"> And so is this... as this uses a json object and gives that to ng-style </div> 或者 ng-class="{'arrow-up-active': arrowNavTriangle === 'up' }"
    转载请注明原文地址: https://ju.6miu.com/read-13578.html

    最新回复(0)