When my Vue component is loaded, it fetches some data from server and place it in the component data: Now I want to watch for its changes, and set a bool dataChanged when it’s changed: The problem is, when data is initially loaded in created, it also triggers the watcher. How do I watch for changes AFTER its initialization? I
Tag: vue.js
Why watcher is better than computed to perform asynchronous or expensive operations in response to changing data in vue.js?
Documentation of Vue.js says: Using the watch option allows us to perform an asynchronous operation (accessing an API), limit how often we perform that operation, and set intermediary states until we get a final answer. None of that would be possible with a computed property. While on the same page, we can see that computed property uses a function the
Build typescript vue apps with only babel?
How can I transpile and build my typescript vue app with only babel? I used the vue-cli-service extensively but reached a point where I just need a minimal setup, without webpack or anything. My .babelrc My package.json dependencies: My entry main.ts file: My App.vue My build script: Answer Unfortunately you cannot build with babel, as it only transpiles languages and
How to use Vue 3 & Add Plugin Boostrap-vue?
I try using Vue 3, but I look can’t using Vue.use(exampleplugin) again. I using command vue add bootstrap-vue after generate vue create project. And on plugin bootstrap-vue warning with code: Output warning terminal: warning in ./src/plugins/bootstrap-vue.js “export ‘default’ (imported as ‘Vue’) was not found in ‘vue’ warning in ./node_modules/bootstrap-vue/esm/utils/vue.js “export ‘default’ (imported as ‘Vue’) was not found in ‘vue’ What’s
Vue-router change query dynamically in navigation stepper
There is this project I’m working on and I’m stuck. I want when I click next step button the route becomes http://icontent.me/app/employer/make-order?step=1 and so on. I’m using Vue.js and vue-router. How do I make this happen? I have included the router.js and a screenshot if necessary. router.js next handler Answer this.$router.push({ path:this.$route.path, query: { step: this.current } })
Passing vue.js store data to a event click handler
I am using regular Vue.js in my project. I store data in a store made from scratch and use it in a template: My pictures are rendering well but now I want to add a delete() function to the picture @click and whenever I click on the button I get: TypeError: Cannot read property ‘url’ of undefined So how can
Skeleton loader component
I’m new to VueJS, and I’m coming to you to find out if what I’ve done is feasible or not. Instead of having old data, while loading components, I prefer to display a preloader. I liked the idea of a skeletons loader, rather than a simple spinner. Right now I have a state in the store, which is null by
How to randomly render products after get API to obtain data in Vue? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question If i have data about products and i want to randomly render products what should i do? Answer You can set a computed property where
Show an element if date is before or after another date using Vue js
I’m using vue to dynamically show elements (called boxes) on the page, but I need to display an element based on if it’s start date is before or after today+1 week. So if the box.start_date is before one week from today, then show it, else hide it. I’m not sure how I can do this in vue ie. I tried
How to concatenate . (dot) with number in javascript
hi ive created visual calc using html and its looks like this .. and ive created function called number() on click on each html element and this is it with numbers 0123456789 everything is working fine but my problem with the . how can i add . to this.total_quantity_discount_price i mean how can i add the number 10.555 or 55.648