@fy-/fws-vue 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composables/seo.ts +16 -8
- package/package.json +1 -1
package/composables/seo.ts
CHANGED
|
@@ -105,10 +105,14 @@ export const useSeo = (seo: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
105
105
|
];
|
|
106
106
|
|
|
107
107
|
metaPairs.forEach(([seoKey, ...properties]) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
const seoValue = seo.value[seoKey as keyof LazyHead];
|
|
109
|
+
console.log(
|
|
110
|
+
`seoKey: ${seoKey}, properties: ${properties}, seoValue: ${seoValue}`,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
if (seoValue !== undefined && seoValue !== null && seoValue !== "") {
|
|
114
|
+
properties.forEach((property) => {
|
|
115
|
+
console.log(`property: ${property}`);
|
|
112
116
|
if (
|
|
113
117
|
property === "description" ||
|
|
114
118
|
property === "keywords" ||
|
|
@@ -116,18 +120,22 @@ export const useSeo = (seo: Ref<LazyHead>, initial: boolean = false) => {
|
|
|
116
120
|
) {
|
|
117
121
|
metas.push({
|
|
118
122
|
name: property,
|
|
119
|
-
content:
|
|
123
|
+
content: seoValue,
|
|
120
124
|
});
|
|
121
125
|
} else {
|
|
122
126
|
metas.push({
|
|
123
127
|
property,
|
|
124
|
-
content:
|
|
128
|
+
content: seoValue as string,
|
|
125
129
|
});
|
|
126
130
|
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
129
133
|
});
|
|
130
134
|
|
|
135
|
+
if (seo.value.description) {
|
|
136
|
+
metas.push({ name: "description", content: seo.value.description });
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
return metas;
|
|
132
140
|
}),
|
|
133
141
|
});
|