-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Svelte class based component example #519
Comments
There's already an issue (#65) for supporting separation of the input html, javascript, and css for a component. There's currently not an automatic way to do that - you would have to combine these manually in your build process before passing the components to the Svelte compiler. I'm not sure what you're asking about ES6 classes. A compiled Svelte component is a class (although an ES5 one). But you interact with javascript classes in the same way whether they were implemented in ES5 syntax or ES6 syntax. In your own application code, outside of the Svelte component, you're free to use whatever syntax or language features you choose. |
Hi @Conduitry, I tried to do somethings using above as a reference, by cloning the I also found that exporting an object literal with braces seems to be very specific requirement, even in |
I also tried to use |
@piyushchauhan2011 For static analysis, each component has to export a static object. For computed properties, you have to specify the function rather than referencing a function so that Svelte knows what params to track. |
closing this as there's no action to take, and #65 tracks separation of input files. thanks |
I'm trying to learn Svelte and TypeScript. I was wondering if there is any pattern to include or program svelte component using
ES6
classes. Currently file contains all the script, html and data, css. I want to make them separate files. Please help me!Cheers,
Piyush
The text was updated successfully, but these errors were encountered: