mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
docs: 使用element-plus-adapter
This commit is contained in:
parent
1ca339f2ea
commit
4090536c97
@ -9,6 +9,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.0.9",
|
"@element-plus/icons-vue": "^2.0.9",
|
||||||
|
"@tmagic/element-plus-adapter": "1.2.0-beta.2",
|
||||||
"@tmagic/form": "1.2.0-beta.2",
|
"@tmagic/form": "1.2.0-beta.2",
|
||||||
"@tmagic/schema": "1.2.0-beta.2",
|
"@tmagic/schema": "1.2.0-beta.2",
|
||||||
"@tmagic/utils": "1.2.0-beta.2",
|
"@tmagic/utils": "1.2.0-beta.2",
|
||||||
|
@ -4,6 +4,7 @@ import 'highlight.js/styles/github.css';
|
|||||||
import './polyfills';
|
import './polyfills';
|
||||||
import { defineClientConfig } from '@vuepress/client';
|
import { defineClientConfig } from '@vuepress/client';
|
||||||
import ElementPlus from 'element-plus';
|
import ElementPlus from 'element-plus';
|
||||||
|
import MagicElementPlusAdapter from '@tmagic/element-plus-adapter';
|
||||||
import MagicForm from '@tmagic/form';
|
import MagicForm from '@tmagic/form';
|
||||||
import DemoBlock from './demo-block.vue';
|
import DemoBlock from './demo-block.vue';
|
||||||
|
|
||||||
@ -11,6 +12,7 @@ export default defineClientConfig({
|
|||||||
enhance({ app, router, siteData }) {
|
enhance({ app, router, siteData }) {
|
||||||
app.use(ElementPlus);
|
app.use(ElementPlus);
|
||||||
app.use(MagicForm, {
|
app.use(MagicForm, {
|
||||||
|
uiAdapter: MagicElementPlusAdapter,
|
||||||
request: (options: any) => new Promise((resolve) => {
|
request: (options: any) => new Promise((resolve) => {
|
||||||
if (options.url === 'select/remote') {
|
if (options.url === 'select/remote') {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
@ -228,6 +228,7 @@ export default defineUserConfig({
|
|||||||
{ find: /^@tmagic\/form/, replacement: path.join(__dirname, '../../../packages/form/src/index.ts') },
|
{ find: /^@tmagic\/form/, replacement: path.join(__dirname, '../../../packages/form/src/index.ts') },
|
||||||
{ find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../../packages/utils/src/index.ts') },
|
{ find: /^@tmagic\/utils/, replacement: path.join(__dirname, '../../../packages/utils/src/index.ts') },
|
||||||
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../../packages/schema/src/index.ts') },
|
{ find: /^@tmagic\/schema/, replacement: path.join(__dirname, '../../../packages/schema/src/index.ts') },
|
||||||
|
{ find: /^@tmagic\/element-plus-adapter/, replacement: path.join(__dirname, '../../../packages/element-plus-adapter/src/index.ts') },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// @ts-expect-error: vite 还没有给 ssr 配置项提供类型
|
// @ts-expect-error: vite 还没有给 ssr 配置项提供类型
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<demo-block type="form" :config="[{
|
<demo-block type="form" :config="[{
|
||||||
type: 'row',
|
type: 'row',
|
||||||
labelWidth: 100,
|
labelWidth: '100px',
|
||||||
span: 8,
|
span: 8,
|
||||||
items: [{
|
items: [{
|
||||||
name: 'text',
|
name: 'text',
|
||||||
@ -34,7 +34,7 @@
|
|||||||
}, {
|
}, {
|
||||||
type: 'row',
|
type: 'row',
|
||||||
span: 12,
|
span: 12,
|
||||||
labelWidth: 100,
|
labelWidth: '100px',
|
||||||
items: [{
|
items: [{
|
||||||
name: 'text4',
|
name: 'text4',
|
||||||
text: '配置1',
|
text: '配置1',
|
||||||
@ -51,11 +51,11 @@
|
|||||||
|
|
||||||
<demo-block type="form" :config="[{
|
<demo-block type="form" :config="[{
|
||||||
name: 'text0',
|
name: 'text0',
|
||||||
labelWidth: 100,
|
labelWidth: '100px',
|
||||||
text: '配置0',
|
text: '配置0',
|
||||||
}, {
|
}, {
|
||||||
type: 'row',
|
type: 'row',
|
||||||
labelWidth: 100,
|
labelWidth: '100px',
|
||||||
items: [{
|
items: [{
|
||||||
name: 'text',
|
name: 'text',
|
||||||
text: '配置1',
|
text: '配置1',
|
||||||
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
<demo-block type="form" :config="[{
|
<demo-block type="form" :config="[{
|
||||||
type: 'fieldset',
|
type: 'fieldset',
|
||||||
labelWidth: 100,
|
labelWidth: '100px',
|
||||||
legend: 'fieldset',
|
legend: 'fieldset',
|
||||||
items: [{
|
items: [{
|
||||||
name: 'text',
|
name: 'text',
|
||||||
|
2
pnpm-lock.yaml
generated
2
pnpm-lock.yaml
generated
@ -77,6 +77,7 @@ importers:
|
|||||||
docs:
|
docs:
|
||||||
specifiers:
|
specifiers:
|
||||||
'@element-plus/icons-vue': ^2.0.9
|
'@element-plus/icons-vue': ^2.0.9
|
||||||
|
'@tmagic/element-plus-adapter': 1.2.0-beta.2
|
||||||
'@tmagic/form': 1.2.0-beta.2
|
'@tmagic/form': 1.2.0-beta.2
|
||||||
'@tmagic/schema': 1.2.0-beta.2
|
'@tmagic/schema': 1.2.0-beta.2
|
||||||
'@tmagic/utils': 1.2.0-beta.2
|
'@tmagic/utils': 1.2.0-beta.2
|
||||||
@ -95,6 +96,7 @@ importers:
|
|||||||
vuepress: ^2.0.0-beta.51
|
vuepress: ^2.0.0-beta.51
|
||||||
dependencies:
|
dependencies:
|
||||||
'@element-plus/icons-vue': 2.0.9_vue@3.2.37
|
'@element-plus/icons-vue': 2.0.9_vue@3.2.37
|
||||||
|
'@tmagic/element-plus-adapter': link:../packages/element-plus-adapter
|
||||||
'@tmagic/form': link:../packages/form
|
'@tmagic/form': link:../packages/form
|
||||||
'@tmagic/schema': link:../packages/schema
|
'@tmagic/schema': link:../packages/schema
|
||||||
'@tmagic/utils': link:../packages/utils
|
'@tmagic/utils': link:../packages/utils
|
||||||
|
Loading…
x
Reference in New Issue
Block a user