美文网首页
vue中使用mui出现的bug

vue中使用mui出现的bug

作者: 胖鱼尾巴 | 来源:发表于2018-07-27 13:38 被阅读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
        }
    

    相关文章

      网友评论

          本文标题:vue中使用mui出现的bug

          本文链接:https://www.haomeiwen.com/subject/avowmftx.html