Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
How to set background-color with vue-router

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

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

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.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda