Ternary not work in v-bind:to
Version
3.2.31
Reproduction link
Steps to reproduce
I make when region.code is empty, not showing ?reg=
<router-link
:to="
$route.href.replace(/\?reg=.{2}/, '') + region.code !== ''
? `?reg=${region.code}`
: ''
"
>
What is expected?
all showing ?reg=
exept empty value
What is actually happening?
All link, include empty region.code showing ?reg=
and when try using this code
<router-link
:to="
region.code !== ''
? $route.href.replace(/\?reg=.{2}/, `?reg=${region.code}`)
: $route.href.replace(/\?reg=.{2}/, '')
"
>
all link not showing ?reg=