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

Error compiling component in demo of the shorthand of class binding #371

Open
Cweili opened this issue Oct 24, 2018 · 0 comments
Open

Error compiling component in demo of the shorthand of class binding #371

Cweili opened this issue Oct 24, 2018 · 0 comments
Labels

Comments

@Cweili
Copy link

Cweili commented Oct 24, 2018

The demo of the shorthand of class binding has "Error compiling component".

Link:

https://svelte.technology/repl?version=2.14.2&demo=bz2ba6

Error:

Computed property name 'is-selected' is invalid — must be a valid identifier such as is_selected
12:     // Because shorthand relfects the var name, you must use component.set({ "is-selected": true }) or use a computed
13:     // property like this. It might be better to avoid shorthand for class names which are not valid variable names.
14:     "is-selected": ({ isSelected }) => isSelected
        ^
15:   }
16: }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants