We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fffbb9e commit 9ed6847Copy full SHA for 9ed6847
types/test/v3/define-component-test.tsx
@@ -1139,6 +1139,14 @@ defineComponent({
1139
}
1140
})
1141
1142
+const X = defineComponent({
1143
+ methods: {
1144
+ foo() {
1145
+ return 123
1146
+ }
1147
1148
+})
1149
+
1150
// Missing / mismatching Vue 2 properties
1151
// https://github.com/vuejs/vue/issues/12628#issuecomment-1177258223
1152
defineComponent({
@@ -1149,6 +1157,11 @@ defineComponent({
1157
this.$ssrContext
1158
this.$isServer
1159
this.$children[0].$root.$children
1160
1161
+ // type casting refs
1162
+ const foo = this.$refs.foo as InstanceType<typeof X>
1163
+ foo.foo().toExponential()
1164
1165
return h('div', {}, [...this.$slots.default!])
1153
1166
1154
1167
0 commit comments