vue中使用mui出现的bug

2018-07-27  本文已影响42人  胖鱼尾巴
template
  <div class="mui-table-view-cell mui-transitioning" v-for="(item,index) in goodsList" :key="index">
              <div class="mui-slider-right mui-disabled">
                <a class="mui-btn mui-btn-red mui-icon mui-icon-trash btn_delete" ref="item" @click="handleDelete(item, index)"></a>
              </div>
              <div class="mui-slider-handle">
               12344566
              </div>
           </div>
方法
handleDelete (item, index) {
      let self = this
      var btnArray=['是','否'];
      mui.confirm("Areyou sure?","Message",btnArray,function(){
        self.goodsList = self.goodsList.filter((v, i) => {
          return index !== i
        })
        self.$store.commit("updateAll", self.goodsList)
      })
    }
监听
 goodsList: {
      handler(){
        let self = this
        this.$store.commit("updateAll", this.goodsList);
        self.$nextTick(() => {
          document.querySelectorAll(".mui-btn")[0].style = ''
          document.querySelectorAll(".mui-slider-handle")[0].style = ''
        })
      },
      deep: true
    }
上一篇下一篇

猜你喜欢

热点阅读