Skip to content
Advertisement

Tag: vue.js

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 understand that there is no such a directive in vue.js This is my function:

Is it possible to discard data errors in a Vue instance?

I will have a lot of variables in my Vue instance modified via API calls. Their initial value is not important. I was hoping there would be a way not to define them upon the instantiation of the vm but this does not work: If I replace data: {} by data: { number: null } the code runs fine. What

Vue.js Routing with back button

I already use this Vue.js Routing example application. In the src/main.js I have so much data value . Now with socket.io i set the token to “sdawdda2d2ada2ad22ad” When application start than the currentRoute is equal with “/” Its okey, the first page loaded. src/routes.js When i want to check the /about (url: localhost:8080/about), than its works good , but the

vue.js is not updating the DOM after updating the array

I read a list of items via AJAX and push it into a data Array: In the Vue devTools in Chrome I can see the updated data array, but the DOM list is still empty. The template: The activeSparepart Object is initialised here: Vue devTools shows the following: Answer I think the problem is that your activeSparepart.attachments is not reactive.

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

How to disable ESLint in vue-cli?

How do I go about disabling ESlint in project generated with vue-cli? If I remove the loader: ‘eslint’ line it won’t compile, same with setting it to an empty string. I know I can opt out of ESLint during the initialization phase, but how can I disable it after my project has been created? Answer Vue’s starter projects are themselves

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