I am seeking a method to pass an environment configuration variable called process.env.config.myVar
to my nuxt-link like this:
:to="{
name: 'search-page',
query: {
process.env.config.myVar: { query: `${searchValue}` }
}
}"
My initial attempt involved using square brackets, however, it ended up printing the entire process.env.config.myVar
as the parameter. I also experimented with assigning it to a data variable like this: myVar= process.env.config.myVar
, and then passing it to nuxt-link:
:to="{
name: 'search-page',
query: {
myVar: { query: `${searchValue}` }
}
}"
Unfortunately, this resulted in myvar
being printed as the parameter. How can I successfully pass the environmental variable to my nuxt-link?