@vueuse/head
Advanced tools
Comparing version 1.0.0-rc.12 to 1.0.0-rc.13
@@ -152,3 +152,3 @@ "use strict"; | ||
const { props, tag: tagName, options } = tag; | ||
if (tagName === "base" || tagName === "title" || tagName === "titleTemplate") | ||
if (["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs"].includes(tagName)) | ||
return tagName; | ||
@@ -500,9 +500,12 @@ if (tagName === "link" && props.rel === "canonical") | ||
var import_vue2 = require("vue"); | ||
var isVue2 = import_vue2.version.startsWith("2."); | ||
var addVNodeToHeadObj = (node, obj) => { | ||
const type = node.type === "html" ? "htmlAttrs" : node.type === "body" ? "bodyAttrs" : node.type; | ||
const nodeType = isVue2 ? node.tag : node.type; | ||
const type = nodeType === "html" ? "htmlAttrs" : nodeType === "body" ? "bodyAttrs" : nodeType; | ||
if (typeof type !== "string" || !(type in obj)) | ||
return; | ||
const props = node.props || {}; | ||
const props = (isVue2 ? (node.data || {}).attrs : node.props) || {}; | ||
if (node.children) { | ||
props.children = Array.isArray(node.children) ? node.children[0].children : node.children; | ||
const childrenAttr = isVue2 ? "text" : "children"; | ||
props.children = Array.isArray(node.children) ? node.children[0][childrenAttr] : node[childrenAttr]; | ||
} | ||
@@ -509,0 +512,0 @@ if (Array.isArray(obj[type])) |
{ | ||
"name": "@vueuse/head", | ||
"version": "1.0.0-rc.12", | ||
"version": "1.0.0-rc.13", | ||
"packageManager": "pnpm@7.5.0", | ||
@@ -58,3 +58,3 @@ "description": "Document head manager for Vue 3. SSR ready.", | ||
"cheerio": "1.0.0-rc.12", | ||
"eslint": "^8.25.0", | ||
"eslint": "^8.26.0", | ||
"execa": "^6.1.0", | ||
@@ -75,3 +75,3 @@ "get-port-please": "^2.6.1", | ||
"vue": "^3.2.41", | ||
"vue-router": "^4.1.5" | ||
"vue-router": "^4.1.6" | ||
}, | ||
@@ -78,0 +78,0 @@ "resolutions": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
60478
1557