3 ms·
I disagree with the assertion that it has "huge set of idiomatic coding principles", but I think that's a matter of opinion. However: > What I also disliked w
by ohceecho 9y ago
I disagree with the assertion that it has "huge set of idiomatic coding principles", but I think that's a matter of opinion.
However:
> What I also disliked was how they don't explain how to get it working without a build-environment like webpack.
This doesn't make sense. The official website includes a way to use it by just including a script from the CDN, on the "Get Started" page. It even discourages using the build tools if you don't have prior experience: https://vuejs.org/v2/guide/ https://vuejs.org/v2/guide/
- amelius 9y ago> The official website includes a way to use it by just including a script from the CDN, on the "Get Started" page. But how about an explanation of how to compile the .vue files (used in the examples) to JS? Or how to do without them?
- baby 9y agoYou don't even use .vue files if you follow the tutorials, this is for an advanced usage.
- ohceecho 9y agoYou mean the examples in the link I posted? Those are just javascript and HTML, there's nothing special about them. Just put that on an HTML file and run it in a browser. No need for any tool other than a text editor. To compile .vue files you have to use vue-cli (linked on the "Get Started" page), or some third-party tool (instructions here: https://vuejs.org/v2/guide/deployment.html https://vuejs.org/v2/guide/deployment.html).
- amelius 9y agoOk, upon a second look, it seems that those directives are translated in-place in the HTML document, so indeed I could have coded the examples in HTML. But it feels a bit like magic. Still, I wonder, how do I make components? Are they also encoded in the DOM tree? It feels a bit strange to encode templates in the actual DOM tree, even without using them.
- icegreentea2 9y agoMy understanding is that if you're using just plain vue.js (without any tools or npm magic), you're not gonna be able to use single file components. You can "do without them" but going to .vue files that you like, and splitting them back up into their HTML and JS bits and copying and pasting them into places you like. vue really isn't at its full potential without using webpack/browsify. But I understand not wanting to use it. For example, we've been sprinkling vue into an existing jquery+bootstrap internal application. It's flask/python, so we just went in and split up things that would be a .vue component into HTML snippets that we can embed using our templating engine, and JS components that you just src include. Now we have bare bones reusuability (no composability though). We'll probably have to swallow the bullet and just figure out webpack/browsify.
- terenceng2010 9y agoI have developed a production vue js app without any building tools.(!) Keep in mind that you should not do so. Some community vue component expect babel helps to transform their es6 code for IE11. Besides, you cant do code splitting, which is an issue when you have many small components to be loaded in the same time. I suggest create your actual project with vue-cli once you get familiar with the vue syntax.