Skip to content
Advertisement

Tag: vuejs2

Vue component event after render

Is there an event in Vue that gets fired after an element re-renders? I have an object that updates, which causes my template to update. After it updates I want to trigger an event which runs a jQuery function. The code looks like this: As you see, I tried using the watch event, however when the watch event triggers, my

Data object defined in created function but NOT reactive?

I have a Vue instance where data property is initialised as an object: And then when the instance is created I add a property to the obj. However, when I want to display the object’s object property count, it shows 0 and is not reactive. If I defined the whole object in the data, it is reactive but I can’t

Typecasting v-for key Vue

I am creating a v-for list based on a range that I am suppling my component: I am suppling my data as a prop like so: My v-for key will always be set as a string though when I log typeof. This is strange since I am passing an object which holds the key as a number and not a

How to format numbers in VueJS

I couldn’t find a way of formatting numbers in VueJS. All I found was the builtin currency filter and vue-numeric for formatting currencies, which needs some modification to look like a label. And then you can’t use it for displaying iterated array members. Answer Install numeral.js: Define the custom filter: Use it:

Why is my v-for statement not reacting to Vue properly?

I have the following code with marker-popup defined here: pointsArray is updated here: However, it does nothing to affect the v-for statement. Whenever the addPoint() method runs, it alters pointsArray in one of two ways It pushes to the array – this works fine, v-for is perfect It changes an element in the array according to what the Vue.js docs

How to define a temporary variable in Vue.js template

Here is my current template: The problem is that i have to write rowLenMap[orderList[n – 1]] multiple times, and i’m afraid vue.js engine will also calculate it multiple times. What i want is something like this: I think it’s not difficult to implement technically because it can be clumsily solved by using something like v-for=”rowLen in [rowLenMap[orderList[n – 1]]]”. So

Advertisement