vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

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

Open Jussiadev opened 7 years ago

Jussiadev commented 7 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';
         }