@monkeyplus/flow 6.0.29 → 6.0.30
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/package.json
CHANGED
package/server/lib/render.mjs
CHANGED
|
@@ -133,6 +133,13 @@ async function renderBody(page) {
|
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
const app = createSSRApp(TemplateRoot);
|
|
136
|
+
app.config.warnHandler = (msg, instance, trace) => {
|
|
137
|
+
const cleanTrace = trace.split("\n").map((line) => {
|
|
138
|
+
return line.length > 200 ? line.substring(0, 200) + " ... >" : line;
|
|
139
|
+
}).join("\n");
|
|
140
|
+
console.warn(`[Vue warn]: ${msg}
|
|
141
|
+
${cleanTrace}`);
|
|
142
|
+
};
|
|
136
143
|
app.provide("context", context);
|
|
137
144
|
app.provide("utils", utils);
|
|
138
145
|
const head = createHead();
|
|
@@ -2,3 +2,4 @@ export { default as FlowIsland } from '../runtime/components/FlowIsland.ts';
|
|
|
2
2
|
export { default as MkImage } from '../runtime/components/MkImage.ts';
|
|
3
3
|
export { default as MkLink } from '../runtime/components/MkLink.ts';
|
|
4
4
|
export { default as MkPicture } from '../runtime/components/MkPicture.ts';
|
|
5
|
+
export { default as MkIcon } from '../runtime/components/MkIcon.ts';
|
|
@@ -2,3 +2,4 @@ export { default as FlowIsland } from "../runtime/components/FlowIsland.mjs";
|
|
|
2
2
|
export { default as MkImage } from "../runtime/components/MkImage.mjs";
|
|
3
3
|
export { default as MkLink } from "../runtime/components/MkLink.mjs";
|
|
4
4
|
export { default as MkPicture } from "../runtime/components/MkPicture.mjs";
|
|
5
|
+
export { default as MkIcon } from "../runtime/components/MkIcon.mjs";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Icon } from "@iconify/vue";
|
|
2
|
+
import { computed, defineComponent, h, Text } from "vue";
|
|
3
|
+
export default defineComponent({
|
|
4
|
+
name: "MkIcon",
|
|
5
|
+
setup(props, { slots, attrs }) {
|
|
6
|
+
const iconName = computed(() => {
|
|
7
|
+
let name = "";
|
|
8
|
+
try {
|
|
9
|
+
const defaultSlot = slots.default?.();
|
|
10
|
+
if (defaultSlot) {
|
|
11
|
+
for (const vnode of defaultSlot) {
|
|
12
|
+
if (typeof vnode.children === "string") {
|
|
13
|
+
name += vnode.children;
|
|
14
|
+
} else if (vnode.type === Text && typeof vnode.children === "string") {
|
|
15
|
+
name += vnode.children;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
} catch (e) {
|
|
20
|
+
name = "";
|
|
21
|
+
}
|
|
22
|
+
return name.trim();
|
|
23
|
+
});
|
|
24
|
+
return () => {
|
|
25
|
+
if (!iconName.value) {
|
|
26
|
+
return h("span", { ...attrs }, slots.default?.());
|
|
27
|
+
}
|
|
28
|
+
return h(Icon, {
|
|
29
|
+
icon: iconName.value,
|
|
30
|
+
...attrs
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
});
|