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

403
Visualizações
<v-btn-toggle> button in vue.js and vuetify causing "Property or method is not defined" error

I'm new in vuetify, and it's the first time i'm using <v-btn-toggle>

I want to add this toggle to be able to filter my user list depending of the type of user, employee, manager or admin...

here is a sample of my code:

<v-btn-toggle
            v-model="toggle_user"
            multiple
            >
            <v-btn :value="employee">
                Employees
            </v-btn>
            <v-btn :value="manager">
                Managers
            </v-btn>
            <v-btn :value="admin">
                Admins
            </v-btn>
            </v-btn-toggle>
data() {
    return {
        toggle_user: 1,
    }
},

I displayed the result on the page using: <p>{{toggle_user}}</p> and it's well showing an array depending on the selected values....

But anytime I click on one of the three buttons, I got an error:

Property or method ["employee" or "manager" or "admin"] is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.

What is wrong with the code I wrote?

Thanks a lot if you can help! Have a nice day!

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

0

It is right there in the error message. There is data that has not been defined yet, but has been referenced during render.

Try the following, and see if that gives the result you are looking for.

<script>
export default {
    data() {
        return {
            toggle_user:1,
            employee: "employee",
            manager: "manager",
            admin: "admin",
        };
    },
};
</script>
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