Skip to content
Advertisement

Tag: vue-component

Confused about vuejs-templates webpack-simple code snippet

I am a newbie of javascript. Start to learn Vue.js by reading the examples. But I am confused about the code snippet of vuejs-templates/webpack-simple. From line 25 I am wondering why code can’t be written like this I have tried both code, the same result. I can’t understand from reading Vue.js document. Please help me to understand this code snippet.

Vue.js devtool change not showing up

I am currently working with moment.js inside a Vue component but I am not seeing certain changes show up in vue devtools. My example: I am guessing this has something to do with the fact that I am calling a method on my moment data property instead of manipulating it directly like a number. An example like this works perfectly

Vue.js – How to properly watch for nested data

I’m trying to understand how to properly watch for some prop variation. I have a parent component (.vue files) that receive data from an ajax call, put the data inside an object and use it to render some child component through a v-for directive, below a simplification of my implementation: … then inside <script> tag: item objects are like this:

Vue $route is not defined

I’m learning Vue router. And I want to made programmatic navigation without using <router-link> in templates file. My router and view: So by default I push to ‘allVideos’ route and inside that component I have a button and method for redirecting to ”editVideo’ button: method: It works fine. But when I try to get id inside a VideoEdit component using

Include global functions in Vue.js

In my Vue.js application I want to have some global functions. For example a callApi() function which I can call every time I need access to my data. What is the best way to include these functions so I can access it in all my components? Should I create a file functions.js and include it in my main.js? Should I

How to add dynamically attribute in VueJs

I’m using vuejs and I wanna know how to have control on inputs (add disabled attribute when necessary). Is there any way to add dynamically attribute in vuejs ? Below my Textfield component : Usage : Answer You can bind it to a variable using v-bind:disabled=”foo” or :disabled=”foo” for short: Then in Vue you can just set this.myVar = true

Communication between sibling components in Vue.js 2.0

Overview In Vue.js 2.x, model.sync will be deprecated. So, what is a proper way to communicate between sibling components in Vue.js 2.x? Background As I understand Vue.js 2.x, the preferred method for sibling communication is to use a store or an event bus. According to Evan (creator of Vue.js): It’s also worth mentioning “passing data between components” is generally a

Advertisement