feat(types): feat(types): add ComponentCustomProperties interface (#982)
This commit is contained in:
20
test-dts/componentCustomProperties.test-d.ts
Normal file
20
test-dts/componentCustomProperties.test-d.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { expectError } from 'tsd'
|
||||
import { defineComponent } from './index'
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
interface ComponentCustomProperties {
|
||||
state: 'stopped' | 'running'
|
||||
}
|
||||
}
|
||||
|
||||
export const Custom = defineComponent({
|
||||
data: () => ({ counter: 0 }),
|
||||
methods: {
|
||||
aMethod() {
|
||||
expectError(this.notExisting)
|
||||
this.counter++
|
||||
this.state = 'running'
|
||||
expectError((this.state = 'not valid'))
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user