Replies: 7 comments 30 replies
-
@ruojianll Since Vue core already has a Something like <script lang="ts">
import { Component, defineClassComponent } from 'vue-facing-decorator'
@Component
class MyComponent extends Vue {}
export default defineClassComponent(MyComponent)
</script> Where function defineClassComponent (ComponentClass) {
const componentInstance = new ComponentClass()
// Map any static and instance ComponentClass values to object for Options API
const componentOptions = ...
return defineComponent(componentOptions)
} |
Beta Was this translation helpful? Give feedback.
-
I released beta version to migrate to decorator stage 3. If you want to try, see https://facing-dev.github.io/vue-facing-decorator/#/en/next-version/next-version |
Beta Was this translation helpful? Give feedback.
-
@ruojianll That's a good point about v-f-d needing to follow vue's decorator settings. I think you're right. So while vue stays with |
Beta Was this translation helpful? Give feedback.
-
@yyx990803 |
Beta Was this translation helpful? Give feedback.
-
@rdhelms |
Beta Was this translation helpful? Give feedback.
-
In |
Beta Was this translation helpful? Give feedback.
-
Decorator proposal is stage 3 now. In this stage, decorator must return a class value (not any value). In v-f-d,
Component
decorator returns vue option component( a plain JS object). Let's discuss how to update to stage 3 decorator proposal.https://github.com/tc39/proposal-decorators
I don't suggest use vue internal
__vccOpt
api, because it is not stable and not documented, so there may should be atoOption
method to convert decorated class to vue option component.https://github.com/vuejs/core/blob/98f1934811d8c8774cd01d18fa36ea3ec68a0a54/packages/runtime-core/src/vnode.ts#L543
Beta Was this translation helpful? Give feedback.
All reactions