• 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'
    },
  • 相关阅读:
    setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
    Kinect 骨骼追踪数据的处理方法
    了解与建设有中国特色的Android M&N(Android6.0和7.0新特性分析)
    【计算机视觉】深度相机(一)--TOF总结
    A million requests per second with Python
    buf.fill()
    buf.slice()
    buf.toJSON()
    buf.toString()
    Buffer.compare()
  • 原文地址:https://www.cnblogs.com/wssdx/p/12890172.html
Copyright © 2020-2023  润新知