mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-11-29 17:58:08 +08:00
parent
b34ca0fb0c
commit
edaa6f6bc9
@ -1,4 +1,5 @@
|
||||
export * from './aria'
|
||||
export * from './date'
|
||||
export * from './event'
|
||||
export * from './key'
|
||||
export * from './size'
|
||||
|
1
packages/constants/key.ts
Normal file
1
packages/constants/key.ts
Normal file
@ -0,0 +1 @@
|
||||
export const INSTALLED_KEY = Symbol('INSTALLED_KEY')
|
@ -4,7 +4,7 @@ export * from '@element-plus/constants'
|
||||
export * from '@element-plus/directives'
|
||||
export * from '@element-plus/hooks'
|
||||
export * from '@element-plus/tokens'
|
||||
export { makeInstaller } from './make-installer'
|
||||
export * from './make-installer'
|
||||
|
||||
export const install = installer.install
|
||||
export const version = installer.version
|
||||
|
@ -1,16 +1,9 @@
|
||||
import { provideGlobalConfig } from '@element-plus/hooks'
|
||||
import { INSTALLED_KEY } from '@element-plus/constants'
|
||||
import { version } from './version'
|
||||
import type { App, Plugin } from '@vue/runtime-core'
|
||||
import type { ConfigProviderContext } from '@element-plus/tokens'
|
||||
|
||||
const INSTALLED_KEY = Symbol('INSTALLED_KEY')
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
interface App {
|
||||
[INSTALLED_KEY]?: boolean
|
||||
}
|
||||
}
|
||||
|
||||
export const makeInstaller = (components: Plugin[] = []) => {
|
||||
const install = (app: App, options?: ConfigProviderContext) => {
|
||||
if (app[INSTALLED_KEY]) return
|
||||
|
@ -6,7 +6,7 @@
|
||||
"lib": ["ES2018", "DOM", "DOM.Iterable"],
|
||||
"types": ["unplugin-vue-define-options"]
|
||||
},
|
||||
"include": ["packages", "typings/components.d.ts", "env.d.ts"],
|
||||
"include": ["packages", "typings/components.d.ts", "typings/env.d.ts"],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/dist",
|
||||
|
5
typings/env.d.ts
vendored
5
typings/env.d.ts
vendored
@ -1,4 +1,5 @@
|
||||
import type { vShow } from 'vue'
|
||||
import type { INSTALLED_KEY } from '@element-plus/constants'
|
||||
|
||||
declare global {
|
||||
const process: {
|
||||
@ -16,6 +17,10 @@ declare global {
|
||||
}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
export interface App {
|
||||
[INSTALLED_KEY]?: boolean
|
||||
}
|
||||
|
||||
export interface GlobalComponents {
|
||||
Component: (props: { is: Component | string }) => void
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user