/
index.ts
42 lines (38 loc) · 1.21 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import Vue, { VueConstructor } from 'vue'
import { Data, SetupFunction, SetupContext } from './component'
import { currentVue } from './runtimeContext'
import { install } from './install'
import { mixin } from './setup'
declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
setup?: SetupFunction<Data, Data>
}
}
const _install = (Vue: VueConstructor) => install(Vue, mixin)
const plugin = {
install: _install,
}
// Auto install if it is not done yet and `window` has `Vue`.
// To allow users to avoid auto-installation in some cases,
if (currentVue && typeof window !== 'undefined' && window.Vue) {
_install(window.Vue)
}
export default plugin
export { nextTick } from './nextTick'
export { default as createElement } from './createElement'
export { SetupContext }
export {
createComponent,
defineComponent,
ComponentRenderProxy,
PropType,
PropOptions,
} from './component'
// For getting a hold of the interal instance in setup() - useful for advanced
// plugins
export { getCurrentVM as getCurrentInstance } from './runtimeContext'
export * from './apis/state'
export * from './apis/lifecycle'
export * from './apis/watch'
export * from './apis/computed'
export * from './apis/inject'