Earlier quoted context omitted.
I think two-way-binding is the reason why many people prefer Vue to React. If you did Ember or Angular1, Vue is much easier to grasp.
Well, one-way binding (or rather, unilateral data flow) is why I prefer React :)
Vue 3.0 Updates [slides]
81–90 of 126 posts
Re: Vue 3.0 Updates [slides]
#82Earlier quoted context omitted.
Having started with vue, and now playing with react, I’ve found myself often thinking “this is so much simpler”. But maybe I just sucked at vue.
That's interesting, I started with React, and switched to Vue, and felt Vue was the simpler tool.
Re: Vue 3.0 Updates [slides]
#83Earlier quoted context omitted.
Well, one-way binding (or rather, unilateral data flow) is why I prefer React :)
"v-model" isn't two-way binding like in AngularJS where both parent and child can modify the same data. It's just shorthand for defining a property and an event handler. Like in React, properties flow down and events flow up. See https://vuejs.org/v2/guide/forms.html
Not really related but forms really are the most painful thing to handle in all those frontend frameworks, it's driving me insane how much work has to go into them when it's dead simple with a backend framework (eg Symfony/Django)!
Re: Vue 3.0 Updates [slides]
#84How about the ability to create multiple components in the same .vue file? for instance I need to define a sub-component that will be used only inside my component, this is easy in React but with Vue I have to create another file to define this sub-component, this makes the project management becomes harder as the project grows
But you can indeed create small inline components in .vue files.
There are different approaches: https://codewithhugo.com/writing-multiple-vue-components-in-...
Re: Vue 3.0 Updates [slides]
#85My feeling is that most people who use Vue or React only need a template engine. Typical use case: You have an array of objects and a template how each object should look like. So you do... {{ user.name }} let userList = new Vue({ el : '#users', data: { users: users } }) ...to make Vue render the list of objects. This is the only thing I ever use these frameworks for. Everything else I think I can implement in a bett…
Re: Vue 3.0 Updates [slides]
#863.0 is a huge milestone for vue. Currently the architecture forces you to import the Vue object entirely , has Vue under the hood isn't really modular... With 3.0 Vue has taken the typescript way and is using packages , similar to angular , it looks absolutely awesome to work with now. I really hope class based components will be supported natively without compiling or transpiling. Working "out of the box" has always…
Re: Vue 3.0 Updates [slides]
#87My feeling is that most people who use Vue or React only need a template engine. Typical use case: You have an array of objects and a template how each object should look like. So you do... {{ user.name }} let userList = new Vue({ el : '#users', data: { users: users } }) ...to make Vue render the list of objects. This is the only thing I ever use these frameworks for. Everything else I think I can implement in a bett…
The point of using Vue is data-binding with reactive models and components.
For your use case I agree Vue is overkill. A templating engine should be enough.
Re: Vue 3.0 Updates [slides]
#88The Typescript support is by far the thing I'm most interested in. Lack of useful Typescript support is, for me, the only downside of Vue right now, and it's a big enough downside for me to use React instead of Vue in a lot of cases. Do you reckon we'll ever see Typescript support in the non-jsx templates? I do really like vue templates for e.g. if-conditionals. I really don't like using ternary operators for templat…
to me the biggest downside was how vuex and typescript didn’t work well together by default. You had to rely to adding a few plumbing functions, and that felt really like dirty patching.
Re: Vue 3.0 Updates [slides]
#89Earlier quoted context omitted.
One should use what is necessary and no more. If server side templates work for you - great. My rule of thumb: if I need to do more then a trivial amount of DOM manipulation then I will use a framework, because otherwise I will end up writing my own anyway (which I can easily do) which wastes development time. For projects with several developers a framework can help maintain common coding style and reduce ramp up ti…
Could you add the lines needed to the above example to make the user list grow / shrink real time via websockets? Would be interested to see how you would implement that.
Vuex code as per docs to create state.stuff and mutations.update_suff() then in main Vue instance
mounted () {
this.$socket.subscribe(‘stuff’, data => {
this.$store.commit(‘update_stuff’, data);
});
where $socket is a subscriber client I wrote wrapped as a Vue plugin.Then inside the components
computed () {
stuff () {
return this.$store.state.stuff;
}
}
then use stuff as in your example.So very simple, and nothing that I couldn’t do without Vue but it takes care of the boring DOM manipulations and using the browser extension during development I can watch state change (which becomes interesting when there are multiple subscriptions with data combined).
Re: Vue 3.0 Updates [slides]
#90Earlier quoted context omitted.
Having started with vue, and now playing with react, I’ve found myself often thinking “this is so much simpler”. But maybe I just sucked at vue.
That's interesting, I started with React, and switched to Vue, and felt Vue was the simpler tool.