How to pass an object as props with vue router?

It can work by using props’s Function mode and params Vue 2 demo: https://jsfiddle.net/hacg6ody/ when adding routes, use props’s Function mode so that it has a default property user and it will add route.params as props. { path: ‘/create’, name: ‘create’, component: CreateComponent, props: (route) => ({ user: userData, …route.params }) } params passed in … Read more

Vue.js – Add class to clicked button

Try to add another data object property called currentIndex and update it to the clicked button index : // DATA data() { return { currentIndex:-1, isActive: false, … inside the template bind the class as follows :class=”{buttonActive : (index==currentIndex) }”: <div class=”buttonBrand”> <button v-for=”(element, index) in brand” :key=”index” :class=”{buttonActive : (index==currentIndex) }” @click=”changeBrand(index)”> <img v-bind:src=”https://stackoverflow.com/questions/57742076/element.imageBrand” … Read more

VUE CLI-3 Project not working on IE-11

I finally ended up with the solution of above issue. To run project on IE-11 version just follow the 2 steps: Install babel-polyfill using command “npm install –save babel-polyfill”. Import babel-polyfill in your main.js or index.js file at the top of above all imported packages. For e.g Here is your main.js file. Note: If you … Read more