Questions tagged [vuejs2]

Use this tag for questions specific to version 2 of Vue.js, an open-source, progressive JavaScript framework for building user interfaces. Consider also using the main [vue.js] tag in addition to this one.

This tag is for questions specific to version 2 of Vue.js, which was released on 1st of October 2016, and has an API similar to version 1.

This tag should be used with the main tag for maximum visibility.


What is Vue.js?

Vue.js is a popular open-source JavaScript framework. It is maintained on Github and created by Evan You, a former Google engineer.

From the introduction in the official Vue.js Guide:

Vue (pronounced /vjuː/, like view) is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects. On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with modern tooling and supporting libraries.

A more in-depth overview of and introduction to Vue's functionality can be found in the Vue.js guide. The API documentation is available here.

Vue.js documentation also includes a comparison page with other frameworks and popular libraries, such as React or Angular.js, if you're looking for how Vue.js compares to other popular JavaScript frameworks.

For further information and resources, see the main tag wiki.


Related Tags


Official Logo:

26324 questions
148
votes
8 answers

Vue.js - Making helper functions globally available to single-file components

I have a Vue 2 project that has many (50+) single-file components. I use Vue-Router for routing and Vuex for state. There is a file, called helpers.js, that contains a bunch of general-purpose functions, such as capitalizing the first letter of a…
Ege Ersoz
  • 6,461
  • 8
  • 34
  • 53
148
votes
6 answers

What's the correct way to pass props as initial data in Vue.js 2?

So I want to pass props to an Vue component, but I expect these props to change in future from inside that component e.g. when I update that Vue component from inside using AJAX. So they are only for initialization of component. My cars-list Vue…
Dominik Serafin
  • 3,616
  • 3
  • 17
  • 27
142
votes
7 answers

How to call a vue.js function on page load

I have a function that helps filter data. I am using v-on:change when a user changes the selection but I also need the function to be called even before the user selects the data. I have done the same with AngularJS previously using ng-init but I…
Phillis Peters
  • 2,232
  • 3
  • 19
  • 40
138
votes
7 answers

Vue - Deep watching an array of objects and calculating the change?

I have an array called people that contains objects as follows: Before [ {id: 0, name: 'Bob', age: 27}, {id: 1, name: 'Frank', age: 32}, {id: 2, name: 'Joe', age: 38} ] It can change: After [ {id: 0, name: 'Bob', age: 27}, {id: 1, name:…
Craig van Tonder
  • 7,497
  • 18
  • 64
  • 109