Skip to content
Advertisement

Tag: javascript

is There an easy way to get all data from vuejs?

I have this data’s is there a way to get all of these? already tried this._data.forEach but it is not working thanks! Answer Vue uses underscore as a prefix for its internal properties. You should avoid using them. The data object for an instance is accessible via the $data property. https://v2.vuejs.org/v2/api/#vm-data So within an instance you can get that object

How to detect when vue component is after update function by property?

I need to display a spinner in vue for every component (this is the requirement). For that I think about to do v-if=”loading” inside component HTML. My question is how to detect when component is loading complete? (meaning after the DOM is rendered, and the data-bind is resolved to the DOM elements) According to Vue lifecycle when update function is

Export SASS/SCSS variables to Javascript without exporting them to CSS

Background Consider the following _variables.scss file: The purpose of the above code is to make the SCSS variables available to Javascript by means of importing like so: See a more detailed description here. The Problem Now consider the following template (I have used as Vue.js template as an example but this is relevant to numerous frameworks): In the above example

I want to add counter in for loop in each item.(vue.js)

I’m making cart app with Vue. And trying to make quantity counter, but when I click – or + button, all of items quantity also increase or decrease. So it seems like I need to give each key for buttons but I don’t know how to do that. Answer Your num variable shouldn’t be in your component and instead you

How to make routes case sensitive in Nuxt

I use nuxt.js + vue.js. I need to create case sensitivity of routers. I found the following property: caseSensitive. I’m trying to put it into nuxt.config but it doesn’t work, the transition is possible by links in upper case. If I directly change the file ~project/.nuxt/router.js, everything works correctly. Help me to figure it out. Answer Your code seems to

Reading excel file into array using javascript

I’m trying to read an excel file and create a multidimensional array in javascript with it. The excel file will look like: I need it to create an array that looks like: So far, I’ve been able to bring up a file selection window, and I believe it’s reading the file, I just think it might not be putting the

Error when trying to target and add classes to html, body, and __nuxt elements in Vue/Nuxt

I’m getting the error “cannot read property ‘classList’ of null” when trying to add/remove classes using document.getElementsByTagName(‘html’).classList, and also for any other high-level elements in the skies above Component Land, such as body or __nuxt. Running in mounted() lifecycle with nextTick function. Also tried checking process.client, but no luck either. Any ideas? Thanks : ) Answer From my comment above,

Advertisement