refactor: enhance type definition (#3062)

* chore: add vue-tsc for type check

* refactor(components): respect Vue's own style type

* refactor(components): improve props type

* chore(build): improve types

* fix(components): remove unnecessary props

* perf(components): use shallowRef

* fix(components): add missing property type for table

* refactor(components): improve time-picker types

* refactor(components): extract import type

* refactor(components): improve popper types

* refactor(components): upload list types

* fix(docs): fix type

* better type

* fix: remove index
This commit is contained in:
Sanxiaozhizi
2021-08-31 09:40:13 +08:00
committed by GitHub
parent 45c292c874
commit 6cc16bbd06
48 changed files with 700 additions and 150 deletions

View File

@@ -1,4 +1,4 @@
import { onMounted, onUpdated, onBeforeUnmount, ref, watch } from 'vue'
import { onMounted, onUpdated, onBeforeUnmount, watch, shallowRef } from 'vue'
import { EVENT_CODE } from '@element-plus/utils/aria'
import { on, off } from '@element-plus/utils/dom'
import TreeStore from './tree-store'
@@ -10,8 +10,8 @@ interface UseKeydownOption {
el$: Ref<HTMLElement>
}
export function useKeydown({ el$ }: UseKeydownOption, store: Ref<TreeStore>) {
const treeItems = ref<Nullable<HTMLElement>[]>([])
const checkboxItems = ref<Nullable<HTMLElement>[]>([])
const treeItems = shallowRef<Nullable<HTMLElement>[]>([])
const checkboxItems = shallowRef<Nullable<HTMLElement>[]>([])
onMounted(() => {
initTabIndex()