You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 27, 2020. It is now read-only.
Considering the Hello example, is there a reason not to use regular imports for CSS and the template property of the Component decorator?
importVuefrom"vue";importComponentfrom"vue-class-component";import"./Hello.css";
@Component({template: require("./Hello.html"),})exportdefaultclassHelloextendsVue{msg="Welcome to Your Vue.js App";constructor(){super();}}
The example in the template is currently:
importVuefrom"vue";importComponentfrom"vue-class-component";importWithRenderfrom"./Hello.html?style=./Hello.css";
@WithRender
@ComponentexportdefaultclassHelloextendsVue{msg="Welcome to Your Vue.js App";constructor(){super();}}
The text was updated successfully, but these errors were encountered:
I think that with the second code, templates are compiled at build time, but with the first one it's compiled at runtime, so it'll be a little slower and requires to embed the vue compiler in the distribution bundle.
Also, Hot Module Reload will not work on templates when using the first code. With latest version, hot-module-reload will work properly if
You use @WithRender decorator to load template
Your component scripts filenames all ends with .vue.ts (or .vue.js)
Considering the
Hello
example, is there a reason not to use regular imports for CSS and thetemplate
property of theComponent
decorator?The example in the template is currently:
The text was updated successfully, but these errors were encountered: