MergedComponentOptions,
RuntimeCompilerOptions
} from './componentOptions'
-import { ComponentPublicInstance } from './componentPublicInstance'
+import {
+ ComponentCustomProperties,
+ ComponentPublicInstance
+} from './componentPublicInstance'
import { Directive, validateDirectiveName } from './directives'
import { RootRenderFunction } from './renderer'
import { InjectionKey } from './apiInject'
performance: boolean
optionMergeStrategies: Record<string, OptionMergeFunction>
- globalProperties: Record<string, any>
+ globalProperties: ComponentCustomProperties & Record<string, any>
errorHandler?: (
err: unknown,
instance: ComponentPublicInstance | null,
}
interface ComponentCustomProperties {
- state: 'stopped' | 'running'
+ state?: 'stopped' | 'running'
}
interface ComponentCustomProps {
expectError(this.notExisting)
this.counter++
this.state = 'running'
+
+ this.$.appContext.config.globalProperties.state = 'running'
+
+ expectError(
+ // @ts-expect-error
+ (this.$.appContext.config.globalProperties.state = 'not valid')
+ )
+
// @ts-expect-error
expectError((this.state = 'not valid'))
}