Closed kshksdrt closed 8 months ago
It discards existing Vue.extends() and its contents. For example,
Vue.extends()
import { Component, Vue } from "vue-property-decorator" import { useRouter } from "vue-router/composables" @Component({}) export default class TodoList extends Vue.extend({ setup() { const todoListStore = useTodoListStore(); const router = useRouter() return { todoListStore, router, }; }, }) { @Watch("todoListStore.todos") onChange() { console.log(this.todoListStore, this.router) } }
becomes
import { useRouter } from 'vue-router/composables' export default { props: {}, name: 'TodoList', setup(props, context) { const onChange = () => { console.log( /* TODO: Check this convert result, it can work well in 80% case.*/ context .root.todoListStore, /* TODO: Check this convert result, it can work well in 80% case.*/ context .root.router ) } // TODO: Please remove unused return variable return { onChange } }, }
It discards existing
Vue.extends()
and its contents. For example,becomes