valaxy 0.15.10 → 0.15.11-alpha.0
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/bin/valaxy.cjs +1 -1
- package/bin/valaxy.mjs +1 -1
- package/client/.vite-ssg-temp/tbbjcbuyn2/CNAME +1 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/PressAlgoliaSearch-2943719f.js +227 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/ValaxyMain-26e77dc6.js +752 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/_...all_-080f97f3.js +31 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/_...all_-5084a1b0.js +42 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/addon-f5fa83e1.js +172 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/best-pratice-0231a551.js +1105 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/client-496183a0.js +286 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/community-1b33ec3b.js +627 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/components-7000ddd3.js +2460 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/deploy-59948619.js +1071 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/docs-26abd7f8.js +490 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/extend-975f8f72.js +1851 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/extend-acd7107b.js +1444 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/faq-62ed7bfd.js +321 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/features-8acbd53d.js +2625 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/gallery-832227a9.js +244 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/gallery-9077df38.js +370 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/getting-started-52c30f03.js +3684 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/hexo-7311896e.js +969 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/hooks-67450cb3.js +517 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/i18n-4cd1bb86.js +4159 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/i18n-e1165bc4.js +676 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-002f83fb.js +768 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-3dec2b83.js +527 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-43565e48.js +424 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-5f07432e.js +563 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-6024f010.js +3294 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-6f0d6ec7.js +202 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-78c510e0.js +549 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-839c338e.js +4161 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-d39a48fd.js +1170 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/index-e633613c.js +1564 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/katex-32f21e80.js +6119 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/logo-bd69f816.js +180 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/markdown-050f3269.js +5895 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/news-ecba2d88.js +278 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/page-d48f3caa.js +752 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/post-ac89eaf5.js +1605 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/route-block-c0a8bdd8.js +4 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/schema-org-f60b7dac.js +477 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/site-6caa6511.js +286 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/style-f415f7fa.css +3742 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/styles-cdaadad2.js +548 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/templates-c97584f2.js +574 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/theme-192f77ef.js +172 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/use-3c036a47.js +669 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/use-851c0307.js +619 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/vite-vue-f91b9792.js +830 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/vscode-bc411e64.js +350 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/why-c98bbe8e.js +1131 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/write-6a43d4d0.js +4963 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/assets/write-6bc2b77c.js +675 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/favicon.svg +33 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/main.mjs +6239 -0
- package/client/.vite-ssg-temp/tbbjcbuyn2/valaxy-logo.png +0 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/CNAME +1 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/PressAlgoliaSearch-2943719f.js +227 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/ValaxyMain-26e77dc6.js +752 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/_...all_-080f97f3.js +31 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/_...all_-5084a1b0.js +42 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/addon-f5fa83e1.js +172 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/best-pratice-0231a551.js +1105 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/client-496183a0.js +286 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/community-1b33ec3b.js +627 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/components-7000ddd3.js +2460 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/deploy-59948619.js +1071 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/docs-26abd7f8.js +490 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/extend-975f8f72.js +1851 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/extend-acd7107b.js +1444 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/faq-62ed7bfd.js +321 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/features-8acbd53d.js +2625 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/gallery-832227a9.js +244 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/gallery-9077df38.js +370 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/getting-started-bb7fc0a8.js +3684 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/hexo-7311896e.js +969 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/hooks-67450cb3.js +517 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/i18n-4cd1bb86.js +4159 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/i18n-e1165bc4.js +676 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-002f83fb.js +768 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-3dec2b83.js +527 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-43565e48.js +424 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-5f07432e.js +563 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-6024f010.js +3294 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-6f0d6ec7.js +202 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-78c510e0.js +549 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-839c338e.js +4161 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-d39a48fd.js +1170 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/index-e633613c.js +1564 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/katex-32f21e80.js +6119 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/logo-bd69f816.js +180 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/markdown-abdb17ca.js +5895 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/news-ecba2d88.js +278 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/page-d48f3caa.js +752 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/post-0ed0dfec.js +1605 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/route-block-c0a8bdd8.js +4 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/schema-org-f60b7dac.js +477 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/site-6caa6511.js +286 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/style-f415f7fa.css +3742 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/styles-cdaadad2.js +548 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/templates-c97584f2.js +574 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/theme-192f77ef.js +172 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/use-3c036a47.js +669 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/use-851c0307.js +619 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/vite-vue-f91b9792.js +830 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/vscode-bc411e64.js +350 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/why-c98bbe8e.js +1131 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/write-6a43d4d0.js +4963 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/assets/write-6bc2b77c.js +675 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/favicon.svg +33 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/main.mjs +6239 -0
- package/client/.vite-ssg-temp/vp12eb5cgm/valaxy-logo.png +0 -0
- package/client/App.vue +1 -1
- package/client/components/AppLink.vue +2 -2
- package/client/components/ValaxyMd.vue +1 -1
- package/client/components/ValaxyOverlay.vue +2 -2
- package/client/components/ValaxyPagination.vue +6 -6
- package/client/components/debug/ValaxyDevtools.vue +6 -0
- package/client/composables/dark.ts +39 -0
- package/client/layouts/404.vue +1 -1
- package/client/layouts/layout.vue +2 -2
- package/client/locales/zh-CN.yml +1 -1
- package/client/pages/[...all].vue +2 -0
- package/client/styles/common/transition.scss +1 -0
- package/client/styles/common/view-transition.css +21 -0
- package/dist/chunk-3EJGKTUH.mjs +130 -0
- package/dist/chunk-RDNVTVQ5.cjs +129 -0
- package/dist/{config-29a16f62.d.ts → config-e5704a2c.d.ts} +223 -1
- package/dist/node/cli/index.cjs +1 -0
- package/dist/node/cli/index.mjs +2 -0
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +14 -2
- package/dist/node/index.d.ts +14 -2
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.cts +3 -220
- package/dist/types/index.d.ts +3 -220
- package/dist/types/index.mjs +1 -1
- package/package.json +19 -18
- package/types/config.ts +6 -0
- package/LICENSE +0 -21
- package/dist/chunk-2EVEFEO4.mjs +0 -130
- package/dist/chunk-BYK2L2MY.cjs +0 -129
- package/dist/node/cli.cjs +0 -1
- package/dist/node/cli.mjs +0 -2
- /package/dist/node/{cli.d.cts → cli/index.d.cts} +0 -0
- /package/dist/node/{cli.d.ts → cli/index.d.ts} +0 -0
|
@@ -0,0 +1,675 @@
|
|
|
1
|
+
import { _ as _export_sfc, a as _sfc_main$1 } from "../main.mjs";
|
|
2
|
+
import { _ as __unplugin_components_0 } from "./ValaxyMain-26e77dc6.js";
|
|
3
|
+
import { provide, mergeProps, withCtx, createTextVNode, createVNode, createCommentVNode, renderSlot, useSSRContext } from "vue";
|
|
4
|
+
import { useRoute } from "vue-router";
|
|
5
|
+
import { ssrRenderComponent, ssrRenderStyle, ssrRenderSlot } from "vue/server-renderer";
|
|
6
|
+
import "vite-ssg";
|
|
7
|
+
import "pinia";
|
|
8
|
+
import "@vueuse/core";
|
|
9
|
+
import "dayjs";
|
|
10
|
+
import "dayjs/plugin/utc.js";
|
|
11
|
+
import "dayjs/plugin/timezone.js";
|
|
12
|
+
import "dayjs/locale/zh-cn.js";
|
|
13
|
+
import "body-scroll-lock";
|
|
14
|
+
import "@intlify/shared";
|
|
15
|
+
import "@intlify/core-base";
|
|
16
|
+
import "@vue/devtools-api";
|
|
17
|
+
import "@unhead/schema-org";
|
|
18
|
+
import "@unhead/vue";
|
|
19
|
+
import "dayjs/plugin/relativeTime.js";
|
|
20
|
+
import "defu";
|
|
21
|
+
import "nprogress";
|
|
22
|
+
import "medium-zoom";
|
|
23
|
+
import "vanilla-lazyload";
|
|
24
|
+
const __pageData = JSON.parse('{"title":"Write a Addon","description":"","frontmatter":{"title":"Write a Addon","title_zh-CN":"编写一个插件","categories":["addon"],"end":false},"headers":[{"level":2,"title":"开始编写","slug":"开始编写","link":"#开始编写","children":[{"level":3,"title":"创建插件模板","slug":"创建插件模板","link":"#创建插件模板","children":[]},{"level":3,"title":"使用生命周期钩子","slug":"使用生命周期钩子","link":"#使用生命周期钩子","children":[]}]}],"relativePath":"pages/addons/write.md","path":"C:\\\\Users\\\\me\\\\repos\\\\yyj\\\\valaxy\\\\docs\\\\pages\\\\addons\\\\write.md","lastUpdated":1697907110000}');
|
|
25
|
+
const data = JSON.parse('{"title":"Write a Addon","description":"","frontmatter":{"title":"Write a Addon","title_zh-CN":"编写一个插件","categories":["addon"],"end":false},"headers":[{"level":2,"title":"开始编写","slug":"开始编写","link":"#开始编写","children":[{"level":3,"title":"创建插件模板","slug":"创建插件模板","link":"#创建插件模板","children":[]},{"level":3,"title":"使用生命周期钩子","slug":"使用生命周期钩子","link":"#使用生命周期钩子","children":[]}]}],"relativePath":"pages/addons/write.md","path":"C:\\\\Users\\\\me\\\\repos\\\\yyj\\\\valaxy\\\\docs\\\\pages\\\\addons\\\\write.md","lastUpdated":1697907110000}');
|
|
26
|
+
const _sfc_main = {
|
|
27
|
+
name: "pages/addons/write.md",
|
|
28
|
+
data() {
|
|
29
|
+
return { data, frontmatter: data.frontmatter, $frontmatter: data.frontmatter };
|
|
30
|
+
},
|
|
31
|
+
setup() {
|
|
32
|
+
const route = useRoute();
|
|
33
|
+
route.meta.frontmatter = Object.assign(route.meta.frontmatter, data.frontmatter);
|
|
34
|
+
provide("pageData", data);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
|
38
|
+
const _component_ValaxyMain = __unplugin_components_0;
|
|
39
|
+
const _component_AppLink = _sfc_main$1;
|
|
40
|
+
_push(ssrRenderComponent(_component_ValaxyMain, mergeProps({
|
|
41
|
+
frontmatter: $data.frontmatter,
|
|
42
|
+
data: $data.data
|
|
43
|
+
}, _attrs), {
|
|
44
|
+
"main-content-md": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
45
|
+
if (_push2) {
|
|
46
|
+
_push2(`<h2 id="开始编写" tabindex="-1"${_scopeId}>开始编写 `);
|
|
47
|
+
_push2(ssrRenderComponent(_component_AppLink, {
|
|
48
|
+
class: "header-anchor",
|
|
49
|
+
href: "#开始编写",
|
|
50
|
+
"aria-label": 'Permalink to "开始编写"'
|
|
51
|
+
}, {
|
|
52
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
53
|
+
if (_push3) {
|
|
54
|
+
_push3(``);
|
|
55
|
+
} else {
|
|
56
|
+
return [
|
|
57
|
+
createTextVNode("")
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
}),
|
|
61
|
+
_: 1
|
|
62
|
+
/* STABLE */
|
|
63
|
+
}, _parent2, _scopeId));
|
|
64
|
+
_push2(`</h2><div class="tip custom-block"${_scopeId}><p class="custom-block-title"${_scopeId}><i class="icon i-carbon-thumbs-up"${_scopeId}></i><span lang="en"${_scopeId}>TIP</span><span lang="zh-CN"${_scopeId}>提示</span></p><p${_scopeId}><strong${_scopeId}>约定大于配置</strong></p><ul${_scopeId}><li${_scopeId}>插件:<code${_scopeId}>Addon</code>,须以 <code${_scopeId}>valaxy-addon-</code> 开头。</li><li${_scopeId}>插件与主题类似,但做的事情更少。</li><li${_scopeId}>一个站点只能使用一个主题,但可以使用多个插件。</li><li${_scopeId}>Addon 无需预编译,直接发布源文件即可。</li></ul></div><ul class="contains-task-list"${_scopeId}><li class="task-list-item"${_scopeId}><p${_scopeId}><input class="task-list-item-checkbox" disabled="" type="checkbox"${_scopeId}> <code${_scopeId}>App.vue</code> 如果插件作者希望插件被使用时立刻全局挂载,可以将内容放置于 <code${_scopeId}>valaxy-addon-<name>/App.vue</code> 中,并设置 <code${_scopeId}>package.json</code> 中 <code${_scopeId}>global: true</code>。</p></li><li${_scopeId}><p${_scopeId}><code${_scopeId}>components</code>: 放置于 <code${_scopeId}>components</code> 文件夹下的组件将会被自动注册,但不会被挂载。用户可以手动加载使用。</p></li></ul><blockquote${_scopeId}><p${_scopeId}>文档正在施工中,您可以参照 `);
|
|
65
|
+
_push2(ssrRenderComponent(_component_AppLink, { href: "/addons/gallery" }, {
|
|
66
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
67
|
+
if (_push3) {
|
|
68
|
+
_push3(`插件橱窗`);
|
|
69
|
+
} else {
|
|
70
|
+
return [
|
|
71
|
+
createTextVNode("插件橱窗")
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
}),
|
|
75
|
+
_: 1
|
|
76
|
+
/* STABLE */
|
|
77
|
+
}, _parent2, _scopeId));
|
|
78
|
+
_push2(` 一些已有的插件。</p></blockquote><!-- 用户如何配置 global --><h3 id="创建插件模板" tabindex="-1"${_scopeId}>创建插件模板 `);
|
|
79
|
+
_push2(ssrRenderComponent(_component_AppLink, {
|
|
80
|
+
class: "header-anchor",
|
|
81
|
+
href: "#创建插件模板",
|
|
82
|
+
"aria-label": 'Permalink to "创建插件模板"'
|
|
83
|
+
}, {
|
|
84
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
85
|
+
if (_push3) {
|
|
86
|
+
_push3(``);
|
|
87
|
+
} else {
|
|
88
|
+
return [
|
|
89
|
+
createTextVNode("")
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
}),
|
|
93
|
+
_: 1
|
|
94
|
+
/* STABLE */
|
|
95
|
+
}, _parent2, _scopeId));
|
|
96
|
+
_push2(`</h3><div class="language-bash"${_scopeId}><button title="Copy Code" class="copy"${_scopeId}></button><span class="lang"${_scopeId}>bash</span><pre class="shiki github-dark vp-code-dark"${_scopeId}><code${_scopeId}><span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#B392F0" })}"${_scopeId}>pnpm</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#9ECBFF" })}"${_scopeId}>create</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#9ECBFF" })}"${_scopeId}>valaxy</span></span>
|
|
97
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#6A737D" })}"${_scopeId}># choose template addon</span></span></code></pre><pre class="shiki github-light vp-code-light"${_scopeId}><code${_scopeId}><span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#6F42C1" })}"${_scopeId}>pnpm</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#032F62" })}"${_scopeId}>create</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#032F62" })}"${_scopeId}>valaxy</span></span>
|
|
98
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#6A737D" })}"${_scopeId}># choose template addon</span></span></code></pre></div><h3 id="使用生命周期钩子" tabindex="-1"${_scopeId}>使用生命周期钩子 `);
|
|
99
|
+
_push2(ssrRenderComponent(_component_AppLink, {
|
|
100
|
+
class: "header-anchor",
|
|
101
|
+
href: "#使用生命周期钩子",
|
|
102
|
+
"aria-label": 'Permalink to "使用生命周期钩子"'
|
|
103
|
+
}, {
|
|
104
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
105
|
+
if (_push3) {
|
|
106
|
+
_push3(``);
|
|
107
|
+
} else {
|
|
108
|
+
return [
|
|
109
|
+
createTextVNode("")
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
}),
|
|
113
|
+
_: 1
|
|
114
|
+
/* STABLE */
|
|
115
|
+
}, _parent2, _scopeId));
|
|
116
|
+
_push2(`</h3><p${_scopeId}>如示例所示,插件可以使用 <code${_scopeId}>valaxy.hook</code> 来挂载生命周期钩子。 实现在构建前/后以及其他节点做一些事情。</p><blockquote${_scopeId}><p${_scopeId}>请参考 `);
|
|
117
|
+
_push2(ssrRenderComponent(_component_AppLink, { href: "/guide/custom/hooks" }, {
|
|
118
|
+
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
|
|
119
|
+
if (_push3) {
|
|
120
|
+
_push3(`生命周期钩子`);
|
|
121
|
+
} else {
|
|
122
|
+
return [
|
|
123
|
+
createTextVNode("生命周期钩子")
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
}),
|
|
127
|
+
_: 1
|
|
128
|
+
/* STABLE */
|
|
129
|
+
}, _parent2, _scopeId));
|
|
130
|
+
_push2(` 了解更多。</p></blockquote><div class="language-ts"${_scopeId}><button title="Copy Code" class="copy"${_scopeId}></button><span class="lang"${_scopeId}>ts</span><pre class="shiki github-dark has-highlighted-lines vp-code-dark"${_scopeId}><code${_scopeId}><span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>import</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> { defineValaxyAddon } </span><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>from</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#9ECBFF" })}"${_scopeId}>'valaxy'</span></span>
|
|
131
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>import</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> consola </span><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>from</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#9ECBFF" })}"${_scopeId}>'consola'</span></span>
|
|
132
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>import</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> pkg </span><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>from</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#9ECBFF" })}"${_scopeId}>'../package.json'</span></span>
|
|
133
|
+
<span class="line"${_scopeId}></span>
|
|
134
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>export</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>const</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#79B8FF" })}"${_scopeId}>addonTest</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>=</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#B392F0" })}"${_scopeId}>defineValaxyAddon</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#FFAB70" })}"${_scopeId}>options</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>=></span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> ({</span></span>
|
|
135
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> name: pkg.name,</span></span>
|
|
136
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> enable: </span><span style="${ssrRenderStyle({ "color": "#79B8FF" })}"${_scopeId}>true</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>,</span></span>
|
|
137
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> options,</span></span>
|
|
138
|
+
<span class="line"${_scopeId}></span>
|
|
139
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#B392F0" })}"${_scopeId}>setup</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#FFAB70" })}"${_scopeId}>valaxy</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>) {</span></span>
|
|
140
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> valaxy.</span><span style="${ssrRenderStyle({ "color": "#B392F0" })}"${_scopeId}>hook</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#9ECBFF" })}"${_scopeId}>'build:before'</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>, () </span><span style="${ssrRenderStyle({ "color": "#F97583" })}"${_scopeId}>=></span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> {</span></span>
|
|
141
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#6A737D" })}"${_scopeId}>// do something before build</span></span>
|
|
142
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> consola.</span><span style="${ssrRenderStyle({ "color": "#B392F0" })}"${_scopeId}>info</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#9ECBFF" })}"${_scopeId}>'[valaxy-addon-test] build:before'</span><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>)</span></span>
|
|
143
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> })</span></span>
|
|
144
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}> },</span></span>
|
|
145
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#E1E4E8" })}"${_scopeId}>}))</span></span></code></pre><pre class="shiki github-light has-highlighted-lines vp-code-light"${_scopeId}><code${_scopeId}><span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>import</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> { defineValaxyAddon } </span><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>from</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#032F62" })}"${_scopeId}>'valaxy'</span></span>
|
|
146
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>import</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> consola </span><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>from</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#032F62" })}"${_scopeId}>'consola'</span></span>
|
|
147
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>import</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> pkg </span><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>from</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#032F62" })}"${_scopeId}>'../package.json'</span></span>
|
|
148
|
+
<span class="line"${_scopeId}></span>
|
|
149
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>export</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>const</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#005CC5" })}"${_scopeId}>addonTest</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>=</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#6F42C1" })}"${_scopeId}>defineValaxyAddon</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#E36209" })}"${_scopeId}>options</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>=></span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> ({</span></span>
|
|
150
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> name: pkg.name,</span></span>
|
|
151
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> enable: </span><span style="${ssrRenderStyle({ "color": "#005CC5" })}"${_scopeId}>true</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>,</span></span>
|
|
152
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> options,</span></span>
|
|
153
|
+
<span class="line"${_scopeId}></span>
|
|
154
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#6F42C1" })}"${_scopeId}>setup</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#E36209" })}"${_scopeId}>valaxy</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>) {</span></span>
|
|
155
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> valaxy.</span><span style="${ssrRenderStyle({ "color": "#6F42C1" })}"${_scopeId}>hook</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#032F62" })}"${_scopeId}>'build:before'</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>, () </span><span style="${ssrRenderStyle({ "color": "#D73A49" })}"${_scopeId}>=></span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> {</span></span>
|
|
156
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> </span><span style="${ssrRenderStyle({ "color": "#6A737D" })}"${_scopeId}>// do something before build</span></span>
|
|
157
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> consola.</span><span style="${ssrRenderStyle({ "color": "#6F42C1" })}"${_scopeId}>info</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>(</span><span style="${ssrRenderStyle({ "color": "#032F62" })}"${_scopeId}>'[valaxy-addon-test] build:before'</span><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>)</span></span>
|
|
158
|
+
<span class="line highlighted"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> })</span></span>
|
|
159
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}> },</span></span>
|
|
160
|
+
<span class="line"${_scopeId}><span style="${ssrRenderStyle({ "color": "#24292E" })}"${_scopeId}>}))</span></span></code></pre></div>`);
|
|
161
|
+
} else {
|
|
162
|
+
return [
|
|
163
|
+
createVNode("h2", {
|
|
164
|
+
id: "开始编写",
|
|
165
|
+
tabindex: "-1"
|
|
166
|
+
}, [
|
|
167
|
+
createTextVNode("开始编写 "),
|
|
168
|
+
createVNode(_component_AppLink, {
|
|
169
|
+
class: "header-anchor",
|
|
170
|
+
href: "#开始编写",
|
|
171
|
+
"aria-label": 'Permalink to "开始编写"'
|
|
172
|
+
}, {
|
|
173
|
+
default: withCtx(() => [
|
|
174
|
+
createTextVNode("")
|
|
175
|
+
]),
|
|
176
|
+
_: 1
|
|
177
|
+
/* STABLE */
|
|
178
|
+
})
|
|
179
|
+
]),
|
|
180
|
+
createVNode("div", { class: "tip custom-block" }, [
|
|
181
|
+
createVNode("p", { class: "custom-block-title" }, [
|
|
182
|
+
createVNode("i", { class: "icon i-carbon-thumbs-up" }),
|
|
183
|
+
createVNode("span", { lang: "en" }, "TIP"),
|
|
184
|
+
createVNode("span", { lang: "zh-CN" }, "提示")
|
|
185
|
+
]),
|
|
186
|
+
createVNode("p", null, [
|
|
187
|
+
createVNode("strong", null, "约定大于配置")
|
|
188
|
+
]),
|
|
189
|
+
createVNode("ul", null, [
|
|
190
|
+
createVNode("li", null, [
|
|
191
|
+
createTextVNode("插件:"),
|
|
192
|
+
createVNode("code", null, "Addon"),
|
|
193
|
+
createTextVNode(",须以 "),
|
|
194
|
+
createVNode("code", null, "valaxy-addon-"),
|
|
195
|
+
createTextVNode(" 开头。")
|
|
196
|
+
]),
|
|
197
|
+
createVNode("li", null, "插件与主题类似,但做的事情更少。"),
|
|
198
|
+
createVNode("li", null, "一个站点只能使用一个主题,但可以使用多个插件。"),
|
|
199
|
+
createVNode("li", null, "Addon 无需预编译,直接发布源文件即可。")
|
|
200
|
+
])
|
|
201
|
+
]),
|
|
202
|
+
createVNode("ul", { class: "contains-task-list" }, [
|
|
203
|
+
createVNode("li", { class: "task-list-item" }, [
|
|
204
|
+
createVNode("p", null, [
|
|
205
|
+
createVNode("input", {
|
|
206
|
+
class: "task-list-item-checkbox",
|
|
207
|
+
disabled: "",
|
|
208
|
+
type: "checkbox"
|
|
209
|
+
}),
|
|
210
|
+
createTextVNode(),
|
|
211
|
+
createVNode("code", null, "App.vue"),
|
|
212
|
+
createTextVNode(" 如果插件作者希望插件被使用时立刻全局挂载,可以将内容放置于 "),
|
|
213
|
+
createVNode("code", null, "valaxy-addon-<name>/App.vue"),
|
|
214
|
+
createTextVNode(" 中,并设置 "),
|
|
215
|
+
createVNode("code", null, "package.json"),
|
|
216
|
+
createTextVNode(" 中 "),
|
|
217
|
+
createVNode("code", null, "global: true"),
|
|
218
|
+
createTextVNode("。")
|
|
219
|
+
])
|
|
220
|
+
]),
|
|
221
|
+
createVNode("li", null, [
|
|
222
|
+
createVNode("p", null, [
|
|
223
|
+
createVNode("code", null, "components"),
|
|
224
|
+
createTextVNode(": 放置于 "),
|
|
225
|
+
createVNode("code", null, "components"),
|
|
226
|
+
createTextVNode(" 文件夹下的组件将会被自动注册,但不会被挂载。用户可以手动加载使用。")
|
|
227
|
+
])
|
|
228
|
+
])
|
|
229
|
+
]),
|
|
230
|
+
createVNode("blockquote", null, [
|
|
231
|
+
createVNode("p", null, [
|
|
232
|
+
createTextVNode("文档正在施工中,您可以参照 "),
|
|
233
|
+
createVNode(_component_AppLink, { href: "/addons/gallery" }, {
|
|
234
|
+
default: withCtx(() => [
|
|
235
|
+
createTextVNode("插件橱窗")
|
|
236
|
+
]),
|
|
237
|
+
_: 1
|
|
238
|
+
/* STABLE */
|
|
239
|
+
}),
|
|
240
|
+
createTextVNode(" 一些已有的插件。")
|
|
241
|
+
])
|
|
242
|
+
]),
|
|
243
|
+
createCommentVNode(" 用户如何配置 global "),
|
|
244
|
+
createVNode("h3", {
|
|
245
|
+
id: "创建插件模板",
|
|
246
|
+
tabindex: "-1"
|
|
247
|
+
}, [
|
|
248
|
+
createTextVNode("创建插件模板 "),
|
|
249
|
+
createVNode(_component_AppLink, {
|
|
250
|
+
class: "header-anchor",
|
|
251
|
+
href: "#创建插件模板",
|
|
252
|
+
"aria-label": 'Permalink to "创建插件模板"'
|
|
253
|
+
}, {
|
|
254
|
+
default: withCtx(() => [
|
|
255
|
+
createTextVNode("")
|
|
256
|
+
]),
|
|
257
|
+
_: 1
|
|
258
|
+
/* STABLE */
|
|
259
|
+
})
|
|
260
|
+
]),
|
|
261
|
+
createVNode("div", { class: "language-bash" }, [
|
|
262
|
+
createVNode("button", {
|
|
263
|
+
title: "Copy Code",
|
|
264
|
+
class: "copy"
|
|
265
|
+
}),
|
|
266
|
+
createVNode("span", { class: "lang" }, "bash"),
|
|
267
|
+
createVNode("pre", { class: "shiki github-dark vp-code-dark" }, [
|
|
268
|
+
createVNode("code", null, [
|
|
269
|
+
createVNode("span", { class: "line" }, [
|
|
270
|
+
createVNode("span", { style: { "color": "#B392F0" } }, "pnpm"),
|
|
271
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
272
|
+
createVNode("span", { style: { "color": "#9ECBFF" } }, "create"),
|
|
273
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
274
|
+
createVNode("span", { style: { "color": "#9ECBFF" } }, "valaxy")
|
|
275
|
+
]),
|
|
276
|
+
createTextVNode("\n"),
|
|
277
|
+
createVNode("span", { class: "line" }, [
|
|
278
|
+
createVNode("span", { style: { "color": "#6A737D" } }, "# choose template addon")
|
|
279
|
+
])
|
|
280
|
+
])
|
|
281
|
+
]),
|
|
282
|
+
createVNode("pre", { class: "shiki github-light vp-code-light" }, [
|
|
283
|
+
createVNode("code", null, [
|
|
284
|
+
createVNode("span", { class: "line" }, [
|
|
285
|
+
createVNode("span", { style: { "color": "#6F42C1" } }, "pnpm"),
|
|
286
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
287
|
+
createVNode("span", { style: { "color": "#032F62" } }, "create"),
|
|
288
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
289
|
+
createVNode("span", { style: { "color": "#032F62" } }, "valaxy")
|
|
290
|
+
]),
|
|
291
|
+
createTextVNode("\n"),
|
|
292
|
+
createVNode("span", { class: "line" }, [
|
|
293
|
+
createVNode("span", { style: { "color": "#6A737D" } }, "# choose template addon")
|
|
294
|
+
])
|
|
295
|
+
])
|
|
296
|
+
])
|
|
297
|
+
]),
|
|
298
|
+
createVNode("h3", {
|
|
299
|
+
id: "使用生命周期钩子",
|
|
300
|
+
tabindex: "-1"
|
|
301
|
+
}, [
|
|
302
|
+
createTextVNode("使用生命周期钩子 "),
|
|
303
|
+
createVNode(_component_AppLink, {
|
|
304
|
+
class: "header-anchor",
|
|
305
|
+
href: "#使用生命周期钩子",
|
|
306
|
+
"aria-label": 'Permalink to "使用生命周期钩子"'
|
|
307
|
+
}, {
|
|
308
|
+
default: withCtx(() => [
|
|
309
|
+
createTextVNode("")
|
|
310
|
+
]),
|
|
311
|
+
_: 1
|
|
312
|
+
/* STABLE */
|
|
313
|
+
})
|
|
314
|
+
]),
|
|
315
|
+
createVNode("p", null, [
|
|
316
|
+
createTextVNode("如示例所示,插件可以使用 "),
|
|
317
|
+
createVNode("code", null, "valaxy.hook"),
|
|
318
|
+
createTextVNode(" 来挂载生命周期钩子。 实现在构建前/后以及其他节点做一些事情。")
|
|
319
|
+
]),
|
|
320
|
+
createVNode("blockquote", null, [
|
|
321
|
+
createVNode("p", null, [
|
|
322
|
+
createTextVNode("请参考 "),
|
|
323
|
+
createVNode(_component_AppLink, { href: "/guide/custom/hooks" }, {
|
|
324
|
+
default: withCtx(() => [
|
|
325
|
+
createTextVNode("生命周期钩子")
|
|
326
|
+
]),
|
|
327
|
+
_: 1
|
|
328
|
+
/* STABLE */
|
|
329
|
+
}),
|
|
330
|
+
createTextVNode(" 了解更多。")
|
|
331
|
+
])
|
|
332
|
+
]),
|
|
333
|
+
createVNode("div", { class: "language-ts" }, [
|
|
334
|
+
createVNode("button", {
|
|
335
|
+
title: "Copy Code",
|
|
336
|
+
class: "copy"
|
|
337
|
+
}),
|
|
338
|
+
createVNode("span", { class: "lang" }, "ts"),
|
|
339
|
+
createVNode("pre", { class: "shiki github-dark has-highlighted-lines vp-code-dark" }, [
|
|
340
|
+
createVNode("code", null, [
|
|
341
|
+
createVNode("span", { class: "line" }, [
|
|
342
|
+
createVNode("span", { style: { "color": "#F97583" } }, "import"),
|
|
343
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " { defineValaxyAddon } "),
|
|
344
|
+
createVNode("span", { style: { "color": "#F97583" } }, "from"),
|
|
345
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
346
|
+
createVNode("span", { style: { "color": "#9ECBFF" } }, "'valaxy'")
|
|
347
|
+
]),
|
|
348
|
+
createTextVNode("\n"),
|
|
349
|
+
createVNode("span", { class: "line" }, [
|
|
350
|
+
createVNode("span", { style: { "color": "#F97583" } }, "import"),
|
|
351
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " consola "),
|
|
352
|
+
createVNode("span", { style: { "color": "#F97583" } }, "from"),
|
|
353
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
354
|
+
createVNode("span", { style: { "color": "#9ECBFF" } }, "'consola'")
|
|
355
|
+
]),
|
|
356
|
+
createTextVNode("\n"),
|
|
357
|
+
createVNode("span", { class: "line" }, [
|
|
358
|
+
createVNode("span", { style: { "color": "#F97583" } }, "import"),
|
|
359
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " pkg "),
|
|
360
|
+
createVNode("span", { style: { "color": "#F97583" } }, "from"),
|
|
361
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
362
|
+
createVNode("span", { style: { "color": "#9ECBFF" } }, "'../package.json'")
|
|
363
|
+
]),
|
|
364
|
+
createTextVNode("\n"),
|
|
365
|
+
createVNode("span", { class: "line" }),
|
|
366
|
+
createTextVNode("\n"),
|
|
367
|
+
createVNode("span", { class: "line" }, [
|
|
368
|
+
createVNode("span", { style: { "color": "#F97583" } }, "export"),
|
|
369
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
370
|
+
createVNode("span", { style: { "color": "#F97583" } }, "const"),
|
|
371
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
372
|
+
createVNode("span", { style: { "color": "#79B8FF" } }, "addonTest"),
|
|
373
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
374
|
+
createVNode("span", { style: { "color": "#F97583" } }, "="),
|
|
375
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
376
|
+
createVNode("span", { style: { "color": "#B392F0" } }, "defineValaxyAddon"),
|
|
377
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, "("),
|
|
378
|
+
createVNode("span", { style: { "color": "#FFAB70" } }, "options"),
|
|
379
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
380
|
+
createVNode("span", { style: { "color": "#F97583" } }, "=>"),
|
|
381
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " ({")
|
|
382
|
+
]),
|
|
383
|
+
createTextVNode("\n"),
|
|
384
|
+
createVNode("span", { class: "line" }, [
|
|
385
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " name: pkg.name,")
|
|
386
|
+
]),
|
|
387
|
+
createTextVNode("\n"),
|
|
388
|
+
createVNode("span", { class: "line" }, [
|
|
389
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " enable: "),
|
|
390
|
+
createVNode("span", { style: { "color": "#79B8FF" } }, "true"),
|
|
391
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, ",")
|
|
392
|
+
]),
|
|
393
|
+
createTextVNode("\n"),
|
|
394
|
+
createVNode("span", { class: "line" }, [
|
|
395
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " options,")
|
|
396
|
+
]),
|
|
397
|
+
createTextVNode("\n"),
|
|
398
|
+
createVNode("span", { class: "line" }),
|
|
399
|
+
createTextVNode("\n"),
|
|
400
|
+
createVNode("span", { class: "line" }, [
|
|
401
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
402
|
+
createVNode("span", { style: { "color": "#B392F0" } }, "setup"),
|
|
403
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, "("),
|
|
404
|
+
createVNode("span", { style: { "color": "#FFAB70" } }, "valaxy"),
|
|
405
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, ") {")
|
|
406
|
+
]),
|
|
407
|
+
createTextVNode("\n"),
|
|
408
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
409
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " valaxy."),
|
|
410
|
+
createVNode("span", { style: { "color": "#B392F0" } }, "hook"),
|
|
411
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, "("),
|
|
412
|
+
createVNode("span", { style: { "color": "#9ECBFF" } }, "'build:before'"),
|
|
413
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, ", () "),
|
|
414
|
+
createVNode("span", { style: { "color": "#F97583" } }, "=>"),
|
|
415
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " {")
|
|
416
|
+
]),
|
|
417
|
+
createTextVNode("\n"),
|
|
418
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
419
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " "),
|
|
420
|
+
createVNode("span", { style: { "color": "#6A737D" } }, "// do something before build")
|
|
421
|
+
]),
|
|
422
|
+
createTextVNode("\n"),
|
|
423
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
424
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " consola."),
|
|
425
|
+
createVNode("span", { style: { "color": "#B392F0" } }, "info"),
|
|
426
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, "("),
|
|
427
|
+
createVNode("span", { style: { "color": "#9ECBFF" } }, "'[valaxy-addon-test] build:before'"),
|
|
428
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, ")")
|
|
429
|
+
]),
|
|
430
|
+
createTextVNode("\n"),
|
|
431
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
432
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " })")
|
|
433
|
+
]),
|
|
434
|
+
createTextVNode("\n"),
|
|
435
|
+
createVNode("span", { class: "line" }, [
|
|
436
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, " },")
|
|
437
|
+
]),
|
|
438
|
+
createTextVNode("\n"),
|
|
439
|
+
createVNode("span", { class: "line" }, [
|
|
440
|
+
createVNode("span", { style: { "color": "#E1E4E8" } }, "}))")
|
|
441
|
+
])
|
|
442
|
+
])
|
|
443
|
+
]),
|
|
444
|
+
createVNode("pre", { class: "shiki github-light has-highlighted-lines vp-code-light" }, [
|
|
445
|
+
createVNode("code", null, [
|
|
446
|
+
createVNode("span", { class: "line" }, [
|
|
447
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "import"),
|
|
448
|
+
createVNode("span", { style: { "color": "#24292E" } }, " { defineValaxyAddon } "),
|
|
449
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "from"),
|
|
450
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
451
|
+
createVNode("span", { style: { "color": "#032F62" } }, "'valaxy'")
|
|
452
|
+
]),
|
|
453
|
+
createTextVNode("\n"),
|
|
454
|
+
createVNode("span", { class: "line" }, [
|
|
455
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "import"),
|
|
456
|
+
createVNode("span", { style: { "color": "#24292E" } }, " consola "),
|
|
457
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "from"),
|
|
458
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
459
|
+
createVNode("span", { style: { "color": "#032F62" } }, "'consola'")
|
|
460
|
+
]),
|
|
461
|
+
createTextVNode("\n"),
|
|
462
|
+
createVNode("span", { class: "line" }, [
|
|
463
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "import"),
|
|
464
|
+
createVNode("span", { style: { "color": "#24292E" } }, " pkg "),
|
|
465
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "from"),
|
|
466
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
467
|
+
createVNode("span", { style: { "color": "#032F62" } }, "'../package.json'")
|
|
468
|
+
]),
|
|
469
|
+
createTextVNode("\n"),
|
|
470
|
+
createVNode("span", { class: "line" }),
|
|
471
|
+
createTextVNode("\n"),
|
|
472
|
+
createVNode("span", { class: "line" }, [
|
|
473
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "export"),
|
|
474
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
475
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "const"),
|
|
476
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
477
|
+
createVNode("span", { style: { "color": "#005CC5" } }, "addonTest"),
|
|
478
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
479
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "="),
|
|
480
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
481
|
+
createVNode("span", { style: { "color": "#6F42C1" } }, "defineValaxyAddon"),
|
|
482
|
+
createVNode("span", { style: { "color": "#24292E" } }, "("),
|
|
483
|
+
createVNode("span", { style: { "color": "#E36209" } }, "options"),
|
|
484
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
485
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "=>"),
|
|
486
|
+
createVNode("span", { style: { "color": "#24292E" } }, " ({")
|
|
487
|
+
]),
|
|
488
|
+
createTextVNode("\n"),
|
|
489
|
+
createVNode("span", { class: "line" }, [
|
|
490
|
+
createVNode("span", { style: { "color": "#24292E" } }, " name: pkg.name,")
|
|
491
|
+
]),
|
|
492
|
+
createTextVNode("\n"),
|
|
493
|
+
createVNode("span", { class: "line" }, [
|
|
494
|
+
createVNode("span", { style: { "color": "#24292E" } }, " enable: "),
|
|
495
|
+
createVNode("span", { style: { "color": "#005CC5" } }, "true"),
|
|
496
|
+
createVNode("span", { style: { "color": "#24292E" } }, ",")
|
|
497
|
+
]),
|
|
498
|
+
createTextVNode("\n"),
|
|
499
|
+
createVNode("span", { class: "line" }, [
|
|
500
|
+
createVNode("span", { style: { "color": "#24292E" } }, " options,")
|
|
501
|
+
]),
|
|
502
|
+
createTextVNode("\n"),
|
|
503
|
+
createVNode("span", { class: "line" }),
|
|
504
|
+
createTextVNode("\n"),
|
|
505
|
+
createVNode("span", { class: "line" }, [
|
|
506
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
507
|
+
createVNode("span", { style: { "color": "#6F42C1" } }, "setup"),
|
|
508
|
+
createVNode("span", { style: { "color": "#24292E" } }, "("),
|
|
509
|
+
createVNode("span", { style: { "color": "#E36209" } }, "valaxy"),
|
|
510
|
+
createVNode("span", { style: { "color": "#24292E" } }, ") {")
|
|
511
|
+
]),
|
|
512
|
+
createTextVNode("\n"),
|
|
513
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
514
|
+
createVNode("span", { style: { "color": "#24292E" } }, " valaxy."),
|
|
515
|
+
createVNode("span", { style: { "color": "#6F42C1" } }, "hook"),
|
|
516
|
+
createVNode("span", { style: { "color": "#24292E" } }, "("),
|
|
517
|
+
createVNode("span", { style: { "color": "#032F62" } }, "'build:before'"),
|
|
518
|
+
createVNode("span", { style: { "color": "#24292E" } }, ", () "),
|
|
519
|
+
createVNode("span", { style: { "color": "#D73A49" } }, "=>"),
|
|
520
|
+
createVNode("span", { style: { "color": "#24292E" } }, " {")
|
|
521
|
+
]),
|
|
522
|
+
createTextVNode("\n"),
|
|
523
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
524
|
+
createVNode("span", { style: { "color": "#24292E" } }, " "),
|
|
525
|
+
createVNode("span", { style: { "color": "#6A737D" } }, "// do something before build")
|
|
526
|
+
]),
|
|
527
|
+
createTextVNode("\n"),
|
|
528
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
529
|
+
createVNode("span", { style: { "color": "#24292E" } }, " consola."),
|
|
530
|
+
createVNode("span", { style: { "color": "#6F42C1" } }, "info"),
|
|
531
|
+
createVNode("span", { style: { "color": "#24292E" } }, "("),
|
|
532
|
+
createVNode("span", { style: { "color": "#032F62" } }, "'[valaxy-addon-test] build:before'"),
|
|
533
|
+
createVNode("span", { style: { "color": "#24292E" } }, ")")
|
|
534
|
+
]),
|
|
535
|
+
createTextVNode("\n"),
|
|
536
|
+
createVNode("span", { class: "line highlighted" }, [
|
|
537
|
+
createVNode("span", { style: { "color": "#24292E" } }, " })")
|
|
538
|
+
]),
|
|
539
|
+
createTextVNode("\n"),
|
|
540
|
+
createVNode("span", { class: "line" }, [
|
|
541
|
+
createVNode("span", { style: { "color": "#24292E" } }, " },")
|
|
542
|
+
]),
|
|
543
|
+
createTextVNode("\n"),
|
|
544
|
+
createVNode("span", { class: "line" }, [
|
|
545
|
+
createVNode("span", { style: { "color": "#24292E" } }, "}))")
|
|
546
|
+
])
|
|
547
|
+
])
|
|
548
|
+
])
|
|
549
|
+
])
|
|
550
|
+
];
|
|
551
|
+
}
|
|
552
|
+
}),
|
|
553
|
+
"main-header": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
554
|
+
if (_push2) {
|
|
555
|
+
ssrRenderSlot(_ctx.$slots, "main-header", {}, null, _push2, _parent2, _scopeId);
|
|
556
|
+
} else {
|
|
557
|
+
return [
|
|
558
|
+
renderSlot(_ctx.$slots, "main-header")
|
|
559
|
+
];
|
|
560
|
+
}
|
|
561
|
+
}),
|
|
562
|
+
"main-header-after": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
563
|
+
if (_push2) {
|
|
564
|
+
ssrRenderSlot(_ctx.$slots, "main-header-after", {}, null, _push2, _parent2, _scopeId);
|
|
565
|
+
} else {
|
|
566
|
+
return [
|
|
567
|
+
renderSlot(_ctx.$slots, "main-header-after")
|
|
568
|
+
];
|
|
569
|
+
}
|
|
570
|
+
}),
|
|
571
|
+
"main-nav": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
572
|
+
if (_push2) {
|
|
573
|
+
ssrRenderSlot(_ctx.$slots, "main-nav", {}, null, _push2, _parent2, _scopeId);
|
|
574
|
+
} else {
|
|
575
|
+
return [
|
|
576
|
+
renderSlot(_ctx.$slots, "main-nav")
|
|
577
|
+
];
|
|
578
|
+
}
|
|
579
|
+
}),
|
|
580
|
+
"main-content": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
581
|
+
if (_push2) {
|
|
582
|
+
ssrRenderSlot(_ctx.$slots, "main-content", {}, null, _push2, _parent2, _scopeId);
|
|
583
|
+
} else {
|
|
584
|
+
return [
|
|
585
|
+
renderSlot(_ctx.$slots, "main-content")
|
|
586
|
+
];
|
|
587
|
+
}
|
|
588
|
+
}),
|
|
589
|
+
"main-content-after": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
590
|
+
if (_push2) {
|
|
591
|
+
ssrRenderSlot(_ctx.$slots, "main-content-after", {}, null, _push2, _parent2, _scopeId);
|
|
592
|
+
} else {
|
|
593
|
+
return [
|
|
594
|
+
renderSlot(_ctx.$slots, "main-content-after")
|
|
595
|
+
];
|
|
596
|
+
}
|
|
597
|
+
}),
|
|
598
|
+
"main-nav-before": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
599
|
+
if (_push2) {
|
|
600
|
+
ssrRenderSlot(_ctx.$slots, "main-nav-before", {}, null, _push2, _parent2, _scopeId);
|
|
601
|
+
} else {
|
|
602
|
+
return [
|
|
603
|
+
renderSlot(_ctx.$slots, "main-nav-before")
|
|
604
|
+
];
|
|
605
|
+
}
|
|
606
|
+
}),
|
|
607
|
+
"main-nav-after": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
608
|
+
if (_push2) {
|
|
609
|
+
ssrRenderSlot(_ctx.$slots, "main-nav-after", {}, null, _push2, _parent2, _scopeId);
|
|
610
|
+
} else {
|
|
611
|
+
return [
|
|
612
|
+
renderSlot(_ctx.$slots, "main-nav-after")
|
|
613
|
+
];
|
|
614
|
+
}
|
|
615
|
+
}),
|
|
616
|
+
comment: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
617
|
+
if (_push2) {
|
|
618
|
+
ssrRenderSlot(_ctx.$slots, "comment", {}, null, _push2, _parent2, _scopeId);
|
|
619
|
+
} else {
|
|
620
|
+
return [
|
|
621
|
+
renderSlot(_ctx.$slots, "comment")
|
|
622
|
+
];
|
|
623
|
+
}
|
|
624
|
+
}),
|
|
625
|
+
footer: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
626
|
+
if (_push2) {
|
|
627
|
+
ssrRenderSlot(_ctx.$slots, "footer", {}, null, _push2, _parent2, _scopeId);
|
|
628
|
+
} else {
|
|
629
|
+
return [
|
|
630
|
+
renderSlot(_ctx.$slots, "footer")
|
|
631
|
+
];
|
|
632
|
+
}
|
|
633
|
+
}),
|
|
634
|
+
aside: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
635
|
+
if (_push2) {
|
|
636
|
+
ssrRenderSlot(_ctx.$slots, "aside", {}, null, _push2, _parent2, _scopeId);
|
|
637
|
+
} else {
|
|
638
|
+
return [
|
|
639
|
+
renderSlot(_ctx.$slots, "aside")
|
|
640
|
+
];
|
|
641
|
+
}
|
|
642
|
+
}),
|
|
643
|
+
"aside-custom": withCtx((_, _push2, _parent2, _scopeId) => {
|
|
644
|
+
if (_push2) {
|
|
645
|
+
ssrRenderSlot(_ctx.$slots, "aside-custom", {}, null, _push2, _parent2, _scopeId);
|
|
646
|
+
} else {
|
|
647
|
+
return [
|
|
648
|
+
renderSlot(_ctx.$slots, "aside-custom")
|
|
649
|
+
];
|
|
650
|
+
}
|
|
651
|
+
}),
|
|
652
|
+
default: withCtx((_, _push2, _parent2, _scopeId) => {
|
|
653
|
+
if (_push2) {
|
|
654
|
+
ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId);
|
|
655
|
+
} else {
|
|
656
|
+
return [
|
|
657
|
+
renderSlot(_ctx.$slots, "default")
|
|
658
|
+
];
|
|
659
|
+
}
|
|
660
|
+
}),
|
|
661
|
+
_: 3
|
|
662
|
+
/* FORWARDED */
|
|
663
|
+
}, _parent));
|
|
664
|
+
}
|
|
665
|
+
const _sfc_setup = _sfc_main.setup;
|
|
666
|
+
_sfc_main.setup = (props, ctx) => {
|
|
667
|
+
const ssrContext = useSSRContext();
|
|
668
|
+
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("../../../docs/pages/addons/write.md");
|
|
669
|
+
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
|
670
|
+
};
|
|
671
|
+
const write = /* @__PURE__ */ _export_sfc(_sfc_main, [["ssrRender", _sfc_ssrRender]]);
|
|
672
|
+
export {
|
|
673
|
+
__pageData,
|
|
674
|
+
write as default
|
|
675
|
+
};
|