小功能总结

2019-05-17  本文已影响0人  张xiao蛋

一,数组去重

// 数组去重1
        var arr = []
        this.multipleSelection = this.multipleSelection.filter(item => {
          let arrlist = this.GoodsChoiceDATA.map(v => v.id)
          return !arrlist.includes(item.id)
        })
        arr = this.multipleSelection
// ES6数组去重
      unique (arr) {
        return Array.from(new Set(arr))
      },

二,添加标签与标签之间添加竖直的分割线(伪类添加)

&:after {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      margin: auto;
      height: 26px;
      width: 1px;
      background: red;
    }
上一篇 下一篇

猜你喜欢

热点阅读