-
Notifications
You must be signed in to change notification settings - Fork 342
Closed
Description
// error
import { defineComponent, ref } from "@vue/composition-api";
export const App = defineComponent({
name: "App",
setup: () => {
const name = ref("");
return () => (
<div>
<div>{name.value}</div>
<input type="text" vModel={name.value} />
</div>
);
}
});
TypeError: __currentInstance.$set is not a function
at input (App.tsx?1c6d:8)
at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
at HTMLInputElement.invoker (vue.runtime.esm.js?2b0e:2179)
at HTMLInputElement.original.\_wrapper (vue.runtime.esm.js?2b0e:6917)
// It's OK to write like this
import { defineComponent, ref } from "@vue/composition-api";
export const App = defineComponent({
name: "App",
setup() {
const name = ref("");
return { name };
},
render() {
return (
<div>
<div>{this.name}</div>
<input type="text" vModel={this.name} />
</div>
);
}
});
Metadata
Metadata
Assignees
Labels
No labels