zoukankan      html  css  js  c++  java
  • avalon数据已更新,视图未更新的bug修复

      $computed: {
                pinlei() {
                    var key = this.currentProduct.key || 'youpin';
                    console.log(key, "我是key")
                    var lang = this.lang;
                    return this.dataProduct[key].category.name[lang]
                },
                jiayou() {
                    var key = this.currentProduct.key || 'youpin';
                    console.log(key, "我是key")
                    var lang = this.lang;
                    return this.dataProduct[key].hot.name[lang]
                }
            },
            <li onclick="javascript:;" ms-click="@openSubItem('hot')" ms-visible="@currentSetting.hot.show" ms-class-1="[@currentSubItem == 'hot' && 'active']">
              <span style="overflow:hidden;vertical-align: bottom;">{{@jiayou}}</span>
    
            </li>
            <li onclick="javascript:;" ms-click="@openSubItem('category')" ms-visible="@currentSetting.category.show" ms-class-1="[@currentSubItem == 'category' && 'active']">
                  <span style="overflow:hidden;vertical-align: bottom;" id='testclick'>{{@pinlei}}
                 </span>
                  
            </li>

    总结:由于代码嵌套太多,所以在切换tab的时候,视图就显示了,所以用avalon的computed进行时时更新......以上是正确的代码哦  ~~~~

  • 相关阅读:
    ASCII&Base64
    CentOS自动同步时间
    Java的HashMap
    Java线程同步操作
    Nginx基本配置与应用
    vc中调用Com组件的方法详解
    VC++ try catch (转)
    oracle中exp,imp的使用详解
    jdbc oracle 连接字符串
    标准的开源实现
  • 原文地址:https://www.cnblogs.com/antyhouse/p/8478207.html
Copyright © 2011-2022 走看看