3 ms·
The major problem with this tutorial is that it doesn't cover single file components (https://vuejs.org/v2/guide/single-file-components.html https://vuejs.org/v
by yunyu 9y ago
The major problem with this tutorial is that it doesn't cover single file components (https://vuejs.org/v2/guide/single-file-components.html https://vuejs.org/v2/guide/single-file-components.html) at all, which are superior to (and preferred to) implementing string based render functions (which rely on a runtime template compiler). Indeed, the Vue NPM package doesn't even provide the runtime template compiler by default. Stuff like what the article promotes are great for development if you just want to include a <script> file, but are clunkier than the way that you're actually supposed to do things.
- yunyu 9y agoTurns out it's mentioned lower down, but the focus of the article is still on Vue.component, which really shouldn't be the case.
- city41 9y agoI've never used Vue, and in many ways am the target audience of this post. From my perspective, I think he took the right approach. Starting right off with a .vue file would be pretty alien to newcomers.
- deskamess 9y ago> The major problem I did not see it as a problem. I appreciated the light weight approach being shown first. In fact, for my use case, I prefer not to bring in the ecosystem. That could change, and the article introduces the heavier approach. > the way that you're actually supposed to do things The one message that comes out of the Vue camp and happy users is that Vue can fit many project types - small to large. Not having to always use single file components is the pragmatic part of that inclusionary message.
- yunyu 9y agoThat approach is actually heavier - the template compiler needs to be distributed (extra 15kb gzipped) and templates need to be rendered at runtime.