Skip to content
Advertisement

Tag: vuejs2

Vue.js event after condition element is rendered

I need event or some workaround how to access currently appended element with v-if in jQuery with $(“.myTarget”) if I use watch on showEl variable it triggers before element renders and I can’t access that element yet. How to achieve to be able to access .myTarget immediately after it renders? Answer Use $nextTick.

Table sorting with index assignment

I have an array of objects: I use it as a model for a buefy table and at the same time, I’m using the extension sortable.js to manually order the table rows: The table is rendered correctly, but I need to update the order parameter on each manually sorting to reflect the real order o the table. For example, I

How to use Vuetify tabs with vue-router

I have the following jsfiddle that has two Vuetify tabs. The documentation doesn’t show examples on using vue-router with them. I found this Medium.com post on how to use Vuetify with vue-router, which has the following code: However, the code is now outdated as the Vuetify 1.0.13 Tabs documentation doesn’t specify a router prop in their api, so the embedded

How to avoid v-if on an element which uses v-for

I have a literal object like so: I was not aware that it was bad to use v-if inside a v-for loop and my first approach to display the code in the view was this: What I was trying to do is to avoid to display a div block related to the type property of the object MenuVoice. Since I

Vue Prop undefined in child component

I am trying to pass an array that inside an object from a parent component to a child component but answers is coming up undefined. When checking the prop in the parent component the data is there, but when it gets past to the child it is undefined. edit: Here is where the parent is declared Parent data: Query: Answer

vue js disable input if value hasn’t changed

I have an input with an initial value: However the disabled binding gives an error: Cannot read property defaultValue of undefined. Best way to do this without spamming vm.data too much? Answer The error: Cannot read property defaultValue of undefined Is because the ref is not available so soon: An important note about the ref registration timing: because the refs

Advertisement