Answer the question
In order to leave comments, you need to log in
How to write such a condition?
I want to display the component, provided that the current path does not have "/page_basket" in it, but it may be that after and before this part of the path there will be something else.
For example:
/page_basket/test // должно равняться false
test/test2 // должно равняться true
/test/page_basket/ //должно равняться false
v-if="$nuxt.$route.path !== '/page_basket'"
Answer the question
In order to leave comments, you need to log in
v-if="$nuxt.$route.path.indexOf( '/page_basket') === -1"
v-if="!$nuxt.$route.path.includes( '/page_basket')"
function f(url) {
url = url.toLocaleLowerCase();
return !url.includes('/page_basket');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question