Skip to content

Commit

Permalink
refactor(components): [tabs] add deprecated mark to activeName (#8590)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolking committed Jul 2, 2022
1 parent 5678464 commit 59392fa
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/components/tabs/src/tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
computed,
defineComponent,
nextTick,
provide,
Expand All @@ -18,7 +19,7 @@ import { EVENT_CODE, UPDATE_MODEL_EVENT } from '@element-plus/constants'
import ElIcon from '@element-plus/components/icon'
import { Plus } from '@element-plus/icons-vue'
import { tabsRootContextKey } from '@element-plus/tokens'
import { useNamespace } from '@element-plus/hooks'
import { useDeprecated, useNamespace } from '@element-plus/hooks'
import TabNav from './tab-nav'
import type { TabNavInstance } from './tab-nav'
import type { TabsPaneContext } from '@element-plus/tokens'
Expand Down Expand Up @@ -135,6 +136,18 @@ export default defineComponent({
emit('tab-add')
}

useDeprecated(
{
from: '"activeName"',
replacement: '"model-value" or "v-model"',
scope: 'ElTabs',
version: '2.3.0',
ref: 'https://element-plus.org/en-US/component/tabs.html#attributes',
type: 'Attribute',
},
computed(() => !!props.activeName)
)

watch(
() => props.activeName,
(modelValue) => setCurrentName(modelValue)
Expand Down

0 comments on commit 59392fa

Please sign in to comment.