mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
refactor(hooks): refactor hooks (#4253)
* refactor(hooks): remove use-css-var * refactor(hooks): remove use-events * refactor(hooks): remove use-migrating * refactor(hooks): remove use-transition * refactor(hooks): named export useAttrs * refactor(hooks): named export useFocus * refactor(hooks): refactor useFormItem * refactor(hooks): refactor useGlobalConfig * refactor(hooks): refactor useLocale * refactor(hooks): refactor useLockscreen * refactor(hooks): refactor useModal * refactor(hooks): refactor useModelToggle * refactor(hooks): refactor usePreventGlobal * refactor(hooks): refactor useRestoreActive * refactor(hooks): refactor useTeleport * refactor(hooks): refactor useThrottleRender * refactor(hooks): refactor useTimeout * refactor(hooks): refactor useTransitionFallthrogh
This commit is contained in:
@@ -222,7 +222,7 @@ import {
|
||||
computed,
|
||||
} from 'vue'
|
||||
import { ClickOutside } from '@element-plus/directives'
|
||||
import { useFocus, useLocaleInject } from '@element-plus/hooks'
|
||||
import { useFocus, useLocale } from '@element-plus/hooks'
|
||||
import ElInput from '@element-plus/components/input'
|
||||
import ElPopper, { Effect } from '@element-plus/components/popper'
|
||||
import ElScrollbar from '@element-plus/components/scrollbar'
|
||||
@@ -331,7 +331,7 @@ export default defineComponent({
|
||||
],
|
||||
|
||||
setup(props, ctx) {
|
||||
const { t } = useLocaleInject()
|
||||
const { t } = useLocale()
|
||||
const states = useSelectStates(props)
|
||||
const {
|
||||
optionsArray,
|
||||
|
||||
@@ -13,7 +13,7 @@ import lodashDebounce from 'lodash/debounce'
|
||||
import isEqual from 'lodash/isEqual'
|
||||
import { UPDATE_MODEL_EVENT, CHANGE_EVENT } from '@element-plus/utils/constants'
|
||||
import { EVENT_CODE } from '@element-plus/utils/aria'
|
||||
import { useLocaleInject } from '@element-plus/hooks'
|
||||
import { useLocale } from '@element-plus/hooks'
|
||||
import isServer from '@element-plus/utils/isServer'
|
||||
import scrollIntoView from '@element-plus/utils/scroll-into-view'
|
||||
import { isKorean } from '@element-plus/utils/isDef'
|
||||
@@ -24,7 +24,7 @@ import type { QueryChangeCtx, SelectOptionProxy } from './token'
|
||||
import type { ElFormContext, ElFormItemContext } from '@element-plus/tokens'
|
||||
|
||||
export function useSelectStates(props) {
|
||||
const { t } = useLocaleInject()
|
||||
const { t } = useLocale()
|
||||
return reactive({
|
||||
options: new Map(),
|
||||
cachedOptions: new Map(),
|
||||
@@ -57,7 +57,7 @@ type States = ReturnType<typeof useSelectStates>
|
||||
|
||||
export const useSelect = (props, states: States, ctx) => {
|
||||
const ELEMENT = useGlobalConfig()
|
||||
const { t } = useLocaleInject()
|
||||
const { t } = useLocale()
|
||||
|
||||
// template refs
|
||||
const reference = ref(null)
|
||||
|
||||
Reference in New Issue
Block a user