Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to defined props in V8.0 #607

Open
keyiis opened this issue Apr 22, 2022 · 1 comment
Open

How to defined props in V8.0 #607

keyiis opened this issue Apr 22, 2022 · 1 comment

Comments

@keyiis
Copy link

keyiis commented Apr 22, 2022

In version 8.0, @ options was used instead of @ component. I defined props in the following way, but I couldn't use this Options access to.
在8.0版本里使用@options取代了@component,我用下面的方法定义了props,但是却无法用this.options访问到

@Options({
  props: {
    options:Object,
  },
})
export default class Ssh extends Vue {
  mounted() {
    console.log(this.options)
  }
}

I saw it in the document https://class-component.vuejs.org/guide/props-definition.html But I think this way of using props is very strange. I even want to give up Vue class component. Is there any way to make the definition of props more natural?
我在文档里看到https://class-component.vuejs.org/guide/props-definition.html,但是我觉得这种使用方式很奇怪,我甚至想放弃vue-class-component,有什么办法能让props的定义更自然些?

@rexwang0128
Copy link

please update official document (https://class-component.vuejs.org/)

I create project by vue create, It install vue-class-component@^8.0.0-0

when I get to the official document and see how it work

I saw the old way @Component, now I know I should use @Option, but official document don't tell me that

I think it's not friendly to new user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants