@yl_lowcode/docs-theme 0.0.3 → 0.0.5
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/demo.vue +3 -4
- package/layout.vue +0 -31
- package/package.json +1 -1
- package/playground.vue +3 -3
package/demo.vue
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
// @ts-nocheck
|
|
3
|
+
import React from "react";
|
|
4
|
+
import * as ReactDOMClient from "react-dom/client";
|
|
3
5
|
import { ref, onMounted, onBeforeUnmount } from "vue";
|
|
4
6
|
import { withBase } from 'vitepress'
|
|
5
7
|
|
|
@@ -17,11 +19,8 @@ let copyTimer: ReturnType<typeof setTimeout> | null = null;
|
|
|
17
19
|
|
|
18
20
|
function mountPreview() {
|
|
19
21
|
if (!previewRef.value) return;
|
|
20
|
-
const React = (window as any).React;
|
|
21
|
-
const ReactDOM = (window as any).ReactDOM;
|
|
22
|
-
if (!React || !ReactDOM) return;
|
|
23
22
|
previewRoot?.unmount();
|
|
24
|
-
previewRoot =
|
|
23
|
+
previewRoot = ReactDOMClient.createRoot(previewRef.value);
|
|
25
24
|
previewRoot.render(React.createElement(props.component));
|
|
26
25
|
}
|
|
27
26
|
function openLive() {
|
package/layout.vue
CHANGED
|
@@ -131,11 +131,6 @@ h2.text {
|
|
|
131
131
|
margin-bottom: 0.5em;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
/* 调整样式 */
|
|
135
|
-
body {
|
|
136
|
-
--vp-code-font-size: 12px !important;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
134
|
.VPDoc.has-aside .content-container {
|
|
140
135
|
max-width: 940px;
|
|
141
136
|
}
|
|
@@ -188,11 +183,6 @@ body {
|
|
|
188
183
|
margin-left: 30px !important;
|
|
189
184
|
}
|
|
190
185
|
|
|
191
|
-
.vp-doc td,
|
|
192
|
-
.vp-doc th {
|
|
193
|
-
font-size: 12px;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
186
|
.custom-block {
|
|
197
187
|
padding: 12px 30px !important;
|
|
198
188
|
}
|
|
@@ -229,10 +219,6 @@ h2.text {
|
|
|
229
219
|
--vp-button-brand-bg: var(--soui-brand-6);
|
|
230
220
|
}
|
|
231
221
|
|
|
232
|
-
body {
|
|
233
|
-
font-size: 12px;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
222
|
.VPNavBar.has-sidebar .content {
|
|
237
223
|
padding-right: 40px !important;
|
|
238
224
|
}
|
|
@@ -240,21 +226,4 @@ body {
|
|
|
240
226
|
h2 {
|
|
241
227
|
margin-left: 0 !important;
|
|
242
228
|
}
|
|
243
|
-
|
|
244
|
-
.VPImage.logo {
|
|
245
|
-
border-radius: 50%;
|
|
246
|
-
height: 30px;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.vp-doc[class*=" _interview"] .custom-block {
|
|
250
|
-
padding: 16px !important;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
.vp-doc[class*=" _interview"] .custom-block summary {
|
|
254
|
-
margin-bottom: 0 !important;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.vp-doc[class*=" _interview"] .custom-block p {
|
|
258
|
-
margin: 0 !important;
|
|
259
|
-
}
|
|
260
229
|
</style>
|
package/package.json
CHANGED
package/playground.vue
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
// @ts-nocheck
|
|
3
|
+
import React from "react";
|
|
4
|
+
import * as ReactDOMClient from "react-dom/client";
|
|
3
5
|
import { ref, inject, onMounted, onBeforeUnmount } from "vue";
|
|
4
6
|
/**
|
|
5
7
|
* 通用 Playground 组件
|
|
@@ -30,8 +32,6 @@ onMounted(async () => {
|
|
|
30
32
|
if (!matchKey) return;
|
|
31
33
|
|
|
32
34
|
const rawCode = (await config.codeGlobs[matchKey]()).raw as string;
|
|
33
|
-
const React = (window as any).React;
|
|
34
|
-
const ReactDOM = (window as any).ReactDOM;
|
|
35
35
|
const { transform } = await import("sucrase");
|
|
36
36
|
const userModules = await config.loadModules();
|
|
37
37
|
|
|
@@ -202,7 +202,7 @@ onMounted(async () => {
|
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
reactRoot =
|
|
205
|
+
reactRoot = ReactDOMClient.createRoot(containerRef.value);
|
|
206
206
|
reactRoot.render(React.createElement(App));
|
|
207
207
|
});
|
|
208
208
|
|