♻️(plugin): 重命名 document plugin, 移动 usePlayground 到 composable

更新文档
This commit is contained in:
就眠儀式 2022-06-24 09:49:55 +08:00
parent 45b23a5898
commit e4bd0aa5a3
12 changed files with 24 additions and 32 deletions

View File

@ -34,8 +34,7 @@
<script setup lang="ts">
import { layer } from "@layui/layer-vue";
import { onMounted, onUnmounted, ref, watch } from "vue";
import { usePlayGround } from "../plugin/usePlayground";
import { usePlayGround } from "../composable/usePlayground";
const meta = ref<HTMLElement>({} as HTMLElement);
const isFixContorl = ref(false);

View File

@ -1,17 +1,17 @@
import vue from "@vitejs/plugin-vue";
import Markdown from "vite-plugin-md";
import container from "markdown-it-container";
import preWrapper from "./pre-wrapper";
import highlight from "./highlight";
import snippet from "./snippet";
import demo from "./demo";
import demo from "./create-demo";
import createTitle from "./create-title";
import createQuote from "./create-quote";
import createDescribe from "./create-describe";
import createTable from "./create-table";
import createAnchor from "./create-anchor";
import preWrapper from "./pre-wrapper";
import previousNext from "./previous-next";
import contributor from "./contributor";
import createPreviousNext from "./create-previous-next";
import createContributor from "./create-contributor";
const plugins = [
vue({
@ -28,15 +28,15 @@ const plugins = [
md.use(snippet)
.use(preWrapper)
.use(container, "demo", demo)
.use(...createTable("table", ""))
.use(...createQuote("quote", ""))
.use(...createTitle("title", ""))
.use(...createDescribe("describe", ""))
.use(...createAnchor("anchor", ""))
.use(...previousNext("previousNext", ""))
.use(...contributor("contributor", ""));
.use(...createTable("table"))
.use(...createQuote("quote"))
.use(...createTitle("title"))
.use(...createDescribe("describe"))
.use(...createAnchor("anchor"))
.use(...createPreviousNext("previousNext"))
.use(...createContributor("contributor"));
},
}),
] as any;
export default plugins;
export default plugins;

View File

@ -8,8 +8,7 @@ type ContainerArgs = [
];
export default function createContainer(
klass: string,
defaultTitle: string
klass: string
): ContainerArgs {
return [
container,

View File

@ -10,8 +10,7 @@ type ContainerArgs = [
];
export default function createContainer(
klass: string,
defaultTitle: string
klass: string
): ContainerArgs {
return [
container,
@ -28,4 +27,4 @@ export default function createContainer(
},
},
];
}
}

View File

@ -8,8 +8,7 @@ type ContainerArgs = [
];
export default function createContainer(
klass: string,
defaultTitle: string
klass: string
): ContainerArgs {
return [
container,

View File

@ -10,8 +10,7 @@ type ContainerArgs = [
];
export default function createContainer(
klass: string,
defaultTitle: string
klass: string
): ContainerArgs {
return [
container,

View File

@ -8,8 +8,7 @@ type ContainerArgs = [
];
export default function createContainer(
klass: string,
defaultTitle: string
klass: string
): ContainerArgs {
return [
container,

View File

@ -8,8 +8,7 @@ type ContainerArgs = [
];
export default function createContainer(
klass: string,
defaultTitle: string
klass: string
): ContainerArgs {
return [
container,

View File

@ -8,8 +8,7 @@ type ContainerArgs = [
];
export default function createContainer(
klass: string,
defaultTitle: string
klass: string
): ContainerArgs {
return [
container,
@ -19,8 +18,8 @@ export default function createContainer(
const token = tokens[idx];
const info = token.info.trim().slice(klass.length).trim();
if (token.nesting === 1) {
return `<lay-field id="${info || defaultTitle}" title="${
info || defaultTitle
return `<lay-field id="${info}" title="${
info
}" style="margin-top:21px;margin-bottom: 20px;">`;
} else {
return "</lay-field>\n";

View File

@ -1,6 +1,6 @@
import path from "path";
import { defineConfig } from "vite";
import plugins from "./src/plugin/common-plugins";
import plugins from "./src/plugin/all-plugins";
export default defineConfig({
resolve: {