4 ms·
What's wrong with Vue? Sure it isn't as widely used as React or Angular but it isn't a small fry either and growing quickly. Plus it is a great first framework
by eberkund 10y ago
What's wrong with Vue? Sure it isn't as widely used as React or Angular but it isn't a small fry either and growing quickly. Plus it is a great first framework because of the fabulous documentation and learning resources available. I also found it to have a much simpler syntax than Angular (I can't comment on React).
- icemelt8 10y agoWhy can't you comment on React? I don't really like Vue.js after coming from ReactJS, main reason is how hard is it to create components, which is the main attraction of React. This is ReactJS code for a List group that has list items which are composed of buttons, can anyone post the Vue.JS equivalent code? var Button = function(props){ return <button>{props.text}</button> } var ListItem = function(props){ return <div>I am a item <Button text="click me" /></div> } var ListGroup = React.createClass({ render: function() { return <div> <ListItem name="hello"/> </div>; } }); ReactDOM.render( <ListGroup />, document.getElementById('container') );
- welanes 10y agoI'm not versed in React but I think this achieves the same thing - 1. Create your custom component: var btnComp = { props: ['text'], template: '<div>I am a button <button v-html="text"></button></div>' } 2. Register it: new Vue({ el: 'body', components: { 'custombtn': btnComp } }) 3. Display it: <custombtn :text="'hello'"></custombtn> That's anything but hard. Here: https://jsfiddle.net/v5s77r2x/ https://jsfiddle.net/v5s77r2x/. *Updated with simpler code and JSfiddle example
- woogley 10y agoIt can even be closer to React than that, especially with JSX render functions. You don't even need the view to name itself: export default Vue.extend({ props: ['text'], render() { return <div>I am a button <button>{this.text}</button></div>; } });
- welanes 10y agoUseful to know. Cheers.
- danesparza 10y agoPS: This can be cleaned up even more with ES6/ES2015 syntax. See https://babeljs.io/blog/2015/06/07/react-on-es6-plus https://babeljs.io/blog/2015/06/07/react-on-es6-plus
- hirzel 10y agoThank you for that link! I am starting in react and there is a blend of ES6 and ES5 in the tutorials (maybe even within the official react tutorials?). This hits the spot in clearing up some confusion for me.
- przeor 10y agoFor React, one step by step complete tutorial for beginners is the https://www.reactjs.co https://www.reactjs.co :-) just sayin;-)
- jkol36 10y agoJust a question. Why would you create a new button component when the only thing it does is return a <button> html element with text inside. Why not just do {listitems.map(listitem) => {return (<button> {listitem.text}</button)}}. I think react facilitates unnecessary boiler plate logic like that. When in reality a component should probably do more in order to save code if it's going to be created at all. Just my opinion. Open to other people's thoughts on this.
- GrinningFool 10y agoI remember when I could show a button with nothing but an html element. Things sure have improved since then!
- glennsl 10y agoPlease stop the fanboyism. OP did not say there was anything wrong with Vue, but asked if there was any specific reason it was chosen, and suggested they try something that comes with good preconfigured defaults to avoid being overwhelmed by all the choices. Which you completely fail to address in your canned sales pitch.
- unculture 10y agoVue comes with good preconfigured defaults, see vue-cli; https://github.com/vuejs/vue-cli https://github.com/vuejs/vue-cli Incidentally, vue-cli predates create-react-app.
- glennsl 10y agoGreat, that's actually useful information. But you could have safely skipped the "first!" comment. Being first does not make you any more superior in the front-end world than it does in a youtube comment.
- unculture 10y agoI couldn't help it, I'm sorry ;-). Although there is a point that Evan You has put a lot of effort into finessing the "developer experience" of using Vue. That includes vue-cli, "blessed" packages surrounding the main library (e.g. Vuex), being able to start using a script tag include if that's easiest, and clear documentation. My "getting started" experience with React (which I use every day) was much more rocky. Admittedly this predates create-react-app.
- kasad 10y agofirst comment was useful
- butu5 10y agoRecently I have created few tutorials on Vue.js. I comes from Angular JS 1 and 2 background. After few days of Vue.js, it seems very simple to begin with you. If you are planning to build a side project, or dashboard kind of stuff so you can definitely give it a try. I feel it's like jquery :) little bit more concept to grasp. Few video tutorials I am creating, you can watch and leave your comments:- https://www.youtube.com/watch?v=Bv3_eTttgso https://www.youtube.com/watch?v=Bv3_eTttgso https://www.youtube.com/watch?v=WSXN-p7jVIk https://www.youtube.com/watch?v=WSXN-p7jVIk https://www.youtube.com/watch?v=VKLUGU7YCFc https://www.youtube.com/watch?v=VKLUGU7YCFc https://www.youtube.com/watch?v=FAa7Er_zQcg https://www.youtube.com/watch?v=FAa7Er_zQcg https://www.youtube.com/watch?v=k5L2uikYkoc https://www.youtube.com/watch?v=k5L2uikYkoc
- Klathmon 10y agoI didn't mean to imply anything was wrong with Vue, I also was trying to keep it somewhat framework agnostic using react as an example (react is just what I'm most comfortable with currently, so it was easy to type up). The Vue question was more out of curiosity, and the fact that more popular frameworks are going to have more "help" available in most cases (learning is one area where it kind of is a popularity contest) My comment probably should have been 2 separate comments.