Comments (5)
That's because callback
isn't a valid field, neither is json
. You should refer to the docs, specifically the DOM events if you need some behaviour similar to callback
https://unhead.harlanzw.com/guide/guides/dom-event-handling
from head.
Hi @nestle49
Would you further explaining what you mean, maybe with a code example as well?
from head.
Before with vue-meta used MetaInfo['script'], now i used Script, but I'm force need 'as' syntax
// eslint-disable-next-line import/no-extraneous-dependencies
import { Script } from '@unhead/schema';
const scripts: Script[] = [];
scripts.push({
innerHTML: [
`bodyScript`
]
.filter(notEmpty)
.join('\n')
} as Script);
useHead({
script: [...scripts],
link: []
});
I need equivalent MetaInfo['script']
from head.
Try something like this
import type { ReactiveHead } from '@vueuse/head'
const script: ReactiveHead['script'] = [];
script.push({
src: 'https://unpkg.com/@unhead/vue@latest/dist/vue.esm-browser.js',
defer: true
})
useHead({
script,
})
from head.
Thanks, but inside ReactiveHead['script'] doesn't exist 'callback' property
scripts.push({
src: '',
async: true,
callback: () => {},
json: {}
});
from head.
Related Issues (20)
- default meta description is not getting replaced HOT 1
- Options API Dynamic Title HOT 3
- Issues when transpiling typeScript into javaScript HOT 6
- useHead script `children` vulnerable to XSS HOT 4
- the requested module does not provide an export named 'default' HOT 1
- website link HOT 1
- useHead does not working with vue router HOT 3
- change icon not work HOT 3
- Dependency not met HOT 2
- Noscript still seems to not be working HOT 1
- How to add "custom-element" tag to script HOT 3
- Deduping from initial head not working HOT 4
- Optional chaining are not compiled to ES5 HOT 2
- @vueuse/head not working properly with vite-plugin-ssr in SSR mode HOT 6
- Why do tags stay despite route change? HOT 9
- Issue with useServerHead or useHead with Vue 2.7 + Vite + Vue Router HOT 3
- Vue 2.5 support HOT 1
- The installation guide link is pointing to a broken link HOT 2
- Google is lowering my indexed pages every day
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from head.