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

v8: component setup function is not called #487

Closed
michael-brade opened this issue Dec 3, 2020 · 1 comment
Closed

v8: component setup function is not called #487

michael-brade opened this issue Dec 3, 2020 · 1 comment

Comments

@michael-brade
Copy link

michael-brade commented Dec 3, 2020

I started playing with vue 3 and vue-class-component 8. I noticed that setup is never called, not matter what I try. Here is my code:

import { SetupContext } from "vue"
import { Vue, prop } from "vue-class-component"

class Props {
  // type is: WithDefault<string>
  title = prop<string>({
    // required: true
    default: "no title"
  });

  // requiredString!: string
}

export default class App extends Vue.with(Props) {
  setup(props: Props, { attrs, slots, emit }: SetupContext) {
    console.error("setup: ", props, attrs, slots, emit)
  }

  mounted() {
    console.error("mounted")
    console.log("title:", this.title)
    this.$nextTick(function() {
      // Code that will run only after the entire view has been rendered
      console.error("everything rendered")
    })
  }
}

If I remove the vue-class-component, then it works. Is this simply not supported (yet) or a bug?

@ktsn
Copy link
Member

ktsn commented Dec 4, 2020

See #416

@ktsn ktsn closed this as completed Dec 4, 2020
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