fix: use same throw error utils function. (#2022)

* fix: use same throw error utils function.

* Update tab-nav.vue

Update error message.

Co-authored-by: jeremywu <15975785+JeremyWuuuuu@users.noreply.github.com>
This commit is contained in:
波比小金刚 2021-05-21 15:47:54 +08:00 committed by GitHub
parent aca8a21f79
commit ce2a9b10c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ import { h, defineComponent, ref, inject, computed, onUpdated, onMounted, onBefo
import { addResizeListener, removeResizeListener, ResizableElement } from '@element-plus/utils/resize-event'
import { EVENT_CODE } from '@element-plus/utils/aria'
import { on, off } from '@element-plus/utils/dom'
import throwError from '@element-plus/utils/error'
import TabBar from './tab-bar.vue'
import { NOOP, capitalize } from '@vue/shared'
import { RootTabs, Pane, ITabType } from './tabs.vue'
@ -46,7 +47,7 @@ export default defineComponent({
setup() {
const rootTabs = inject<RootTabs>('rootTabs')
if (!rootTabs) {
throw new Error(`ElTabNav must use with ElTabs`)
throwError('[ElTabNav]', `ElTabNav must be nested inside ElTabs`)
}
const scrollable = ref<boolean | Scrollable>(false)