File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ import {
1111 MergedComponentOptions ,
1212 RuntimeCompilerOptions
1313} from './componentOptions'
14- import { ComponentPublicInstance } from './componentPublicInstance'
14+ import {
15+ ComponentCustomProperties ,
16+ ComponentPublicInstance
17+ } from './componentPublicInstance'
1518import { Directive , validateDirectiveName } from './directives'
1619import { RootRenderFunction } from './renderer'
1720import { InjectionKey } from './apiInject'
@@ -70,7 +73,7 @@ export interface AppConfig {
7073
7174 performance : boolean
7275 optionMergeStrategies : Record < string , OptionMergeFunction >
73- globalProperties : Record < string , any >
76+ globalProperties : ComponentCustomProperties & Record < string , any >
7477 errorHandler ?: (
7578 err : unknown ,
7679 instance : ComponentPublicInstance | null ,
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ declare module '@vue/runtime-core' {
66 }
77
88 interface ComponentCustomProperties {
9- state : 'stopped' | 'running'
9+ state ? : 'stopped' | 'running'
1010 }
1111
1212 interface ComponentCustomProps {
@@ -35,6 +35,14 @@ export const Custom = defineComponent({
3535 expectError ( this . notExisting )
3636 this . counter ++
3737 this . state = 'running'
38+
39+ this . $ . appContext . config . globalProperties . state = 'running'
40+
41+ expectError (
42+ // @ts -expect-error
43+ ( this . $ . appContext . config . globalProperties . state = 'not valid' )
44+ )
45+
3846 // @ts -expect-error
3947 expectError ( ( this . state = 'not valid' ) )
4048 }
You can’t perform that action at this time.
0 commit comments