chore: 渲染器支持渲染 antdv

This commit is contained in:
wangxuefeng
2025-03-21 20:56:42 +08:00
parent e6b8146ee0
commit 580468a3e9
5 changed files with 457 additions and 418 deletions

View File

@@ -25,6 +25,7 @@
"@vtj/ui": "^0.11.5", "@vtj/ui": "^0.11.5",
"@vtj/utils": "^0.11.5", "@vtj/utils": "^0.11.5",
"@vtj/web": "^0.11.5", "@vtj/web": "^0.11.5",
"ant-design-vue": "catalog:",
"axios": "catalog:", "axios": "catalog:",
"core-js": "catalog:", "core-js": "catalog:",
"element-plus": "catalog:", "element-plus": "catalog:",

View File

@@ -5,6 +5,7 @@ import { VueQueryPlugin } from '@tanstack/vue-query';
import * as VtjCharts from '@vtj/charts'; import * as VtjCharts from '@vtj/charts';
import { IconsPlugin } from '@vtj/icons'; import { IconsPlugin } from '@vtj/icons';
import * as VtjUI from '@vtj/ui'; import * as VtjUI from '@vtj/ui';
import Antd from 'ant-design-vue';
import ElementPlus from 'element-plus'; import ElementPlus from 'element-plus';
import App from './App.vue'; import App from './App.vue';
@@ -36,7 +37,9 @@ Object.entries(VtjUI).forEach(([name, component]) => {
Object.entries(VtjCharts).forEach(([name, component]) => { Object.entries(VtjCharts).forEach(([name, component]) => {
app.component(name, component); app.component(name, component);
}); });
app app
.use(Antd)
.use(ElementPlus) .use(ElementPlus)
.use(IconsPlugin) .use(IconsPlugin)
.use(VueQueryPlugin) .use(VueQueryPlugin)

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sy/wujie-vue3-renderer-adapter", "name": "@sy/wujie-vue3-renderer-adapter",
"version": "1.0.0-alpha.8", "version": "1.0.0-alpha.12",
"description": "wujie-vue3 ycode renderer adapter", "description": "wujie-vue3 ycode renderer adapter",
"type": "module", "type": "module",
"scripts": { "scripts": {

View File

@@ -50,19 +50,19 @@ const props = withDefaults(
const { bus } = WujieVue; const { bus } = WujieVue;
// 定义无界插件 // // 定义无界插件
const wujiePlugins = [ // const wujiePlugins = [
{ // {
patchElementHook(element: Element, iframeWindow: Window) { // patchElementHook(element: Element, iframeWindow: Window) {
if (element.nodeName === 'STYLE') { // if (element.nodeName === 'STYLE') {
element.insertAdjacentElement = function (_position, ele) { // element.insertAdjacentElement = function (_position, ele) {
iframeWindow.document.head.append(ele); // iframeWindow.document.head.append(ele);
}; // };
} // }
}, // },
}, // },
InstanceofPlugin(), // // InstanceofPlugin(),
]; // ];
// 生命周期钩子 // 生命周期钩子
const beforeLoad = (appWindow: Window) => { const beforeLoad = (appWindow: Window) => {
@@ -125,7 +125,6 @@ onBeforeUnmount(() => {
<template> <template>
<WujieVue <WujieVue
:id="`wujie-vue3-adapter-${fileId}`"
:name="name || fileId" :name="name || fileId"
:url="finalUrl" :url="finalUrl"
:sync="sync" :sync="sync"
@@ -134,6 +133,5 @@ onBeforeUnmount(() => {
:before-load="beforeLoad" :before-load="beforeLoad"
:after-mount="afterMount" :after-mount="afterMount"
:interceptors="interceptors" :interceptors="interceptors"
:plugins="wujiePlugins"
/> />
</template> </template>

841
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff