Posts

Showing posts with the label vue-router

Vue.js router-link doesn't work on firefox

Vue.js router-link doesn't work on firefox I have this button component: <button :class="classes" v-on="$listeners" v-bind="$attrs"> <template v-if="to"> <router-link :to="to" class="flex center-v"> <AqIcon :icon="icon" v-if="icon" /> <slot></slot> </router-link> </template> <template v-else> <AqIcon :icon="icon" v-if="icon" /> <slot></slot> </template> </button> It can accepts a :to prop and in that case I use a router-link instead of just text. :to When I use it like this: <AqButton primary icon="plus" :to="{name:'editUser',params:{id:'new'}}"> Add User </AqButton> On chrome it works fine, but on FF the url changes but it stays on the same page. 1 Answer...

Keep alive view-router by key param

Keep alive view-router by key param How do I keep vue-router alive with different params separately? TL:DR : Let's consider an example when we're developing a website like facebook. Each user has a profile page. Because there are a lot of users we don't want to iterate all users and load all profile page on load like bellow <template v-for="profile in profilePages"> <profile-page :data="profile" v-show="this.route.params['id'] === channel.id"/> </template> The common approach would be: router.js : { component: ProfileWrapper, path: '/profile', children: [ { path: ':id', component: ProfilePage } ] } ChannelsPage : <keep-alive> <router-view :=key="$route.fullPath"></router-view> </keep-alive> But here's the issue. Since user visits someone's page and navigates away, I want the router to keep it alive in cache somewhere, or just hi...