I have an instance of mounted in Vue, where I’m trying to set a date picker having the starting date depends on a data fed by an ajax response. Let’s say this data property is named start_date. I run my ajax request via the created instance in Vue. It’s a little weird when I tried to console log vm.myObject, it
Tag: vuejs2
Vue2: warning: Avoid mutating a prop directly
I’m stuck in the situation where my child component (autocomplete) needs to update a value of its parent (Curve), And the parent needs to update the one of the child (or to completely re-render when a new Curve component is used) In my app the user can select a Curve in a list of Curve components. My previous code worked
Check if props in vue.js component template exists
After tried many variations, I don’t know how to properly style a component’s slot or partial code within <template></template> section. Is there a way to check if props <counter :recent=”true”></counter> from parent level exists, so in a Counter.vue in section <template></template> i would show a special html markup for it ? === UPDATED === Answer Here the default value for
Vue.js: Calling function on change
I’m building a component in Vue.js. I have an input on the page where the user can request a certain credit amount. Currently, I’m trying to make a function that will log the input amount to the console, as I type it in. (Eventually, I’m going to show/hide the requested documents based on the user input. I don’t want them
Vue non reactive data available on instance
I want to store object in vue, it should be available for entire instance and not be reactive. Normally (with reactive) I would use ‘data’ like this: But in fact myObject don’t need to change so I think making it reactive is bad. Is there any method to do this? Answer You can use Vue Instance Properties. There may be
How to use filter to search in multiple key values of objects in an array?
I have an array of wines containing objects with data for each wine: I can figure out how to search — case insensitive — for a wine object, while specifying which key of the object to search in, like this: Returns: However, if var search = ‘Winery 3’ or var search = ‘red’ then it will obviously return no results,
Vuejs transition on table rows
I’m trying to have a transition (animation) on html table row (vue.js) with no success. Here’s the full example I am expecting that the hidden table row should appear with transition/animation on opacity property when it appears, but nothing is happening, how am I supposed to do so? This is perfectly working on another element like span or other. Answer
How to determine whether a checkbox is checked or not in Vue js
I just want to determine whether a checkbox is checked or not in Vue js 2. In jquery we have functions like $(‘input[type=checkbox]’).prop(‘checked’); which will return true if checkbox is checked or not. What is the equivalent function in Vue js. Here is the scenario with code. Please note i am using laravel with its blade templates. The js part
Vue.js To add class active when click and remove the previous one
I want to achieve this active link on my div element here you can see the example that i want to do with my code http://jsfiddle.net/fiddleyetu/9ff79/ in here using vue.js i can’t do the active link on my div elements here is my code for the elements on which i have to do the links active js Answer I’m new
Watching parent with prop doesn’t update during for loop
I have 2 components – <my-component> and <grand-child-comp>. In my root there is a multidimensional object and my component watches it with prop. In Vue debugger, I can see that my-component is getting and watching accountTypes object successfully. However, when trying to use it in my-component’s template, it doesn’t work. Lastly, accountTypes object looks like: Answer The problem is you’re