<template>
<div>
<Button @click="handAdd">添加</Button>
<Tabs type="card" closable @on-click="tabClick" @on-tab-remove="moveClick">
<Tab-pane
v-for="(item, index) in tabList"
:name="item"
:label="item"
:key="item"
:disabled="flag"
>{
{ item }}</Tab-pane
>
</Tabs>
</div>
</template>
<script>
export default {
data() {
return {
count: "许舟舟",
ind: 0,
tabList: ["tab1", "tab2"],
flag: false,
};
},
created() {},
computed: {},
methods: {
handAdd() {
this.flag = false;
if (this.tabList.length > 4) {
this.$Message.error("最多添加5项");
return;
}
this.ind++;
this.tabList.push("标签
iview---tabs标签页限制最长与最少长度
于 2023-03-22 18:56:16 首次发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)