Skip to content

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 …

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 t…

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 activeSparepar…

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? Shoul…

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? A…