mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
feat: add validation for removing last tab
This commit is contained in:
parent
fb510ed1a3
commit
900a7a1ca9
@ -20,6 +20,10 @@ function handleTabsEdit(targetName, action) {
|
|||||||
}
|
}
|
||||||
else if (action === `remove`) {
|
else if (action === `remove`) {
|
||||||
const tabs = store.cssContentConfig.tabs
|
const tabs = store.cssContentConfig.tabs
|
||||||
|
if (tabs.length === 1) {
|
||||||
|
ElMessage.warning(`至少保留一个方案`)
|
||||||
|
return
|
||||||
|
}
|
||||||
let activeName = store.cssContentConfig.active
|
let activeName = store.cssContentConfig.active
|
||||||
if (activeName === targetName) {
|
if (activeName === targetName) {
|
||||||
tabs.forEach((tab, index) => {
|
tabs.forEach((tab, index) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user