mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
refactor(nuxt): deprecate <Script>
component tag in template (#8197)
This commit is contained in:
parent
256c1fd4fc
commit
5e7dfc2338
@ -66,6 +66,10 @@ const globalProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// <script>
|
// <script>
|
||||||
|
|
||||||
|
let scriptDeprecated = false
|
||||||
|
|
||||||
|
/** @deprecated */
|
||||||
export const Script = defineComponent({
|
export const Script = defineComponent({
|
||||||
// eslint-disable-next-line vue/no-reserved-component-names
|
// eslint-disable-next-line vue/no-reserved-component-names
|
||||||
name: 'Script',
|
name: 'Script',
|
||||||
@ -93,6 +97,11 @@ export const Script = defineComponent({
|
|||||||
renderPriority: [String, Number]
|
renderPriority: [String, Number]
|
||||||
},
|
},
|
||||||
setup: setupForUseMeta((props, { slots }) => {
|
setup: setupForUseMeta((props, { slots }) => {
|
||||||
|
if (process.dev && !scriptDeprecated) {
|
||||||
|
console.log('[nuxt] `<Script>` is deprecated and may be removed in a future release. We advise using `useHead()` directly.')
|
||||||
|
scriptDeprecated = true
|
||||||
|
}
|
||||||
|
|
||||||
const script = { ...props }
|
const script = { ...props }
|
||||||
const textContent = (slots.default?.() || [])
|
const textContent = (slots.default?.() || [])
|
||||||
.filter(({ children }) => children)
|
.filter(({ children }) => children)
|
||||||
|
Loading…
Reference in New Issue
Block a user