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
7
votes
1 answer

Adding the Intro.JS library to a Vue-Cli / Webpack project

I'm building my first project using vue-cli and webpack and I'm not sure how to properly use an external JavaScript library to my project. I want to add the Intro.js library which simply requires me to import the intro.js, add some tags to some…
Daniel D
  • 918
  • 9
  • 18
7
votes
1 answer

Vue listen for Vuex commit?

Is there a way to listen to a Vuex commit without watching any of the properties that are changed with the commit? Just simply finding out if a commit has happened? I have a Filter component that I want to put into a NPM package but I already have a…
Stephan-v
  • 19,255
  • 31
  • 115
  • 201
7
votes
1 answer

How to use vue.js syntax inside a string template with dropzone.js

I am currently trying to implement dropzone.js Doc Ref - into my application. But since i've managed to run the basic functionallity of dropzone.js I want to customize the preview-template to hide and show the upload progressbar during different…
Sagar Naliyapara
  • 3,971
  • 5
  • 41
  • 61
7
votes
3 answers

How to declare variables in custom VueJS directives?

I've got an error when tried to declare a variable in the usual way like this: Vue.directive('my-directive', { varA: '', inserted: function(el, binding, vnode){ this.varA = 'test'; // TypeError: Cannot set property…
Evgeniy Miroshnichenko
  • 1,788
  • 2
  • 19
  • 30
7
votes
3 answers

2 way data binding with Vuex

In the code below I'm 2 way binding the output of a textarea into a p element, once from the component's internal state and once from Vuex. The Vuex state does show the initial value, but the value doesn't update as I add or delete text (as it does…
Sean D
  • 3,810
  • 11
  • 45
  • 90
7
votes
4 answers

Call a VueJS method inside a component outside 'export default'

I'm trying to call a function inside 'method' from outside. However, it isn't working. Github issue reporting the same: https://github.com/vuejs/vue/issues/329 vm.test(); // call a function in method, not working this.vue.test() // not…
Gijo Varghese
  • 11,264
  • 22
  • 73
  • 122
7
votes
3 answers

Can v-if trigger something? Does v-if raise an event?

I would like to catch an event and do something when v-if toggles. A conditionally rendered element is rendering. It should be possible to get notified of this, no?
bbsimonbb
  • 27,056
  • 15
  • 80
  • 110
7
votes
2 answers

Updating an item in an array updates them all

I'm working on an application using vuejs with vuex which uses projects, with each project having one or more jobs. I can add, delete and update the jobs. The adding and deleting is working perfect, but the updating is not. The state in the vuex…
vincent
  • 1,243
  • 4
  • 15
  • 29
7
votes
5 answers

vue-router : router-link not working

I'm trying to use vue-router and router-link. When I click on the link, the URL updates correctly, but nothing is loaded into . I'm guessing this has something to do with using the unpkg CDNs rather than building this with…
rpivovar
  • 3,150
  • 13
  • 41
  • 79
7
votes
2 answers

Hide a component in Vue.js

Is there a way with which I can control the rendering of a shared component in another component? I have a component which is a bottom bar which needs to be disabled/ not rendered in a few concrete components. I am rendering the bottom bar in a…
manjith dungdung
  • 91
  • 1
  • 1
  • 3
7
votes
3 answers

router-view content not rendering

The router-view content of my app always remains empty () even though routing itself works perfectly and templates are correctly rendered throughout the app. (Note: Even though there's just a import Vue from 'vue';, I'm using the standalone…
maelgrove
  • 939
  • 3
  • 9
  • 18
7
votes
1 answer

Vue.js - Element UI - Dynamic rules validation form

I'm using vue-js2.3 and element-ui. I would like to define the validation rules of my form dynamically Example https://jsfiddle.net/cgL6y9kq/ Problem The required is not dynamically defined by phoneMandatory Questions How can I change the attribute…
Léo Coco
  • 4,022
  • 11
  • 52
  • 97
7
votes
2 answers

Dynamically insert child components inside vuejs2 data (without $compile or abusing v-html)

I'd like to insert new vuejs components on the fly, at arbitrary points within a block of not-necessarily-predefined HTML. Here's a slightly contrived example that demonstrates the sort of thing I'm trying to do: Vue.component('child', { //…
Daniel Beck
  • 20,653
  • 5
  • 38
  • 53
7
votes
4 answers

Restrict vue/vuex reactivity

Let's assume we have some array of objects, and these objects never change. For example, that may be search results, received from google maps places api - every result is rather complex object with id, title, address, coordinates, photos and a…
Kasheftin
  • 7,509
  • 11
  • 41
  • 68
7
votes
2 answers

Vue component not updated when props are async

I have this component