• iview的标签组件Tabs的用法


     <Tabs type="card" closable @on-tab-remove="handleTabRemove"   
    @on-click="tabsFun" ref="tabs"
      v-model="activeName" :before-remove="beforeRemove" >
              <TabPane v-for="(item, index ) in dataList" :key="item.productCodeSuffix" :name="item.productCodeSuffix"
                :label="'套装' + item.productCodeSuffix">
                <SuitFormInfo :ref="'formInfo'+index" :dataInfo="item" :isEdit="isEdit"
                  @getOrderDetailsList="orderDetailsList(item,index)" />
                <FormSKUInfo :ref="'formSKUInfo'+index" :skuDataList="item.skuList" :isEdit="isEdit" />
              </TabPane>
              <Button @click="handleTabsAdd" size="small" slot="extra">增加</Button>
    </Tabs>
    //tab关闭之前
          beforeRemove() {
            const that = this;
            if (that.dataList.length == 1) {
              return new Promise(function (resolve, reject) {
                that.$Message.warning('不可删除!');
                reject();
              })

            }

          }
    //   tab关闭
          handleTabRemove(val) {
            this.dataList = this.dataList.filter(item => item.productCodeSuffix !== val)
            this.activeName = this.dataList[0].productCodeSuffix
          },
    //默认展示的tab
    init() {
                    this.$refs.tabs.activeKey = 'name'
    },
  • 相关阅读:
    Interrupt、Interrupted、IsInterrupted
    ReentrantLock
    tcp粘包、拆包
    jstat 分析应用垃圾回收状况
    CopyOnWriteArrayList
    storm基础概念
    余弦距离
    websocket
    awk
    sed
  • 原文地址:https://www.cnblogs.com/wssdx/p/12890172.html
走看看 - 开发者的网上家园