I need to clarify this question: I am using the vue-router library to be able to create the routes of my project and I need to know how I can configure the background-color by routes. I was planning to do it this way:
import meeting from '../components/meeting.vue'
import { colors } from 'vuetify/lib'
Vue.use(VueRouter)
const routes = [
{
path: '/meeting/:roomId',
name: 'meeting',
component: meeting,
meta: {
backgroundColor:colors.transparent ,
}
},
]
const router = new VueRouter({
routes
});
But it doesn't work, any suggestions please
You could watch the route in the component you wish to change the background color and insert the business logic there.
To create watchers you can do so by:
watch: {
$route.path: function (val) {
this.backgroundColor = whateverYouWant
},
}
If you want this behavior to be used in other components too you can also create a mixin with this watcher.