N
Nuxt2y ago
Dewdew

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.
No description
7 Replies
Dewdew
DewdewOP2y ago
i pretendard like this picture, but, it not work.. my reproduction..TT
No description
harlan
harlan2y ago
what's the problem exactly? in your reproduction you need to move index.vue to pages/index.vue
Dewdew
DewdewOP2y ago
@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', }, ], });
harlan
harlan2y ago
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
Dewdew
DewdewOP2y ago
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 ...
harlan
harlan2y ago
sorry I don't really follow
Dewdew
DewdewOP2y ago
@harlan thank you for helping me T.T ...
Want results from more Discord servers?
Add your server