How can i do In Page.vue / useHead() script innerHTML ?
i try to below reproduction,
It just not working javascript works
how can i use useHead() in innerHtml script?
please help me TT
my reproduction
https://stackblitz.com/edit/github-g5wswv-pe9kph?file=pages%2Findex.vue
StackBlitz
Nuxt - Starter (forked) - StackBlitz
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
7 Replies
i pretendard like this picture,
but, it not work.. my reproduction..TT
what's the problem exactly?
in your reproduction you need to move
index.vue
to pages/index.vue
@harlan
opps! i moved index.vue:)
my concern is,
I want to write a script as innerHTML in usehead(),
If you reproduce it, it does not come out in the form of a function like I put in a comment, but in the form of text, so I wonder if I'm using it properly!
useHead({
script: [
{
children:
var_nasa={};if(window.wcs)_nasa.cnv=wcs.cnv("${2}","${
data.value
}");
,
type: 'text/javascript',
},
],
});what do you mean in the form of a function
that is valid HTML isn't it
it's just spits out whatever you give it
I need to read script code on another site that I have set useHead() to "children".
If so, if I leave it as it is, can I access it from other sites? TT ...
sorry I don't really follow
@harlan thank you for helping me T.T ...