vuejs / Discussion

Vue.js discussion
166 stars 17 forks source link

Use ||(or) in v-if (with nuxt js) #1312

Open Jussiadev opened 6 years ago

Jussiadev commented 6 years ago

I need, that component was on a page '/brands' or '/brand'. I try, but it does't work

 <div v-if="brandsOrBrand">
            <AlphabetSearch/>
        </div>

in script

computed: {
         brandsOrBrand() {
             return this.$route.fullPath == '/brands' || this.$route.fullPath == '/brand';
         }