2
0
mirror of https://github.com/tenrok/vue-meta.git synced 2026-06-16 10:50:33 +03:00

doc: add tips about inline script in README.md script example (#304)

This commit is contained in:
William Chong
2019-01-25 05:48:04 +08:00
committed by Alexander Lichter
parent d174c8876c
commit bf7035baf5
+18 -1
View File
@@ -536,12 +536,29 @@ Each item in the array maps to a newly-created `<style>` element, where object p
Each item in the array maps to a newly-created `<script>` element, where object properties map to attributes.
```js
{
metaInfo: {
script: [
{ src: 'https://cdn.jsdelivr.net/npm/vue/dist/vue.js', async: true, defer: true }
],
}
}
```
```html
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js" async="true" defer="true"></script>
```
:warning: You have to disable sanitizers so the content of `innerHTML` won't be escaped. Please refer to [\__dangerouslyDisableSanitizers](#__dangerouslydisablesanitizers-string) section below for more info on related risks.
```js
{
metaInfo: {
script: [
{ innerHTML: '{ "@context": "http://schema.org" }', type: 'application/ld+json' }
]
],
__dangerouslyDisableSanitizers: ['script'],
}
}
```