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

Move the props declaration to the script #55

Open
danieldietrich opened this issue Feb 20, 2022 · 1 comment
Open

Move the props declaration to the script #55

danieldietrich opened this issue Feb 20, 2022 · 1 comment
Labels
🚀 enhancement New feature or request ⃝ medium-priority This can be solved later 🙅‍♀️ wontfix This will not be worked on

Comments

@danieldietrich
Copy link
Owner

Currently we define default values. It would be better to define types.

props: {
  selected: Boolean,
  index: Number
}

One challenge is to evaluate the script before defining the custom class because the prop names are needed for these static observedAttributes method.

@danieldietrich danieldietrich added ⃝ medium-priority This can be solved later 🚀 enhancement New feature or request labels Feb 20, 2022
@danieldietrich
Copy link
Owner Author

After thinking about it, we should leave it, as-is.

Vue for example needs a props type definitions and a script which returns a data function, which in turn return the prop values. That is quite a bit.

Candid just defines the props (= observed attributes), which combine initial values and therefore types. That is simpler than the approach of Vue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 enhancement New feature or request ⃝ medium-priority This can be solved later 🙅‍♀️ wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant