docs: 更新教程

This commit is contained in:
roymondchen 2023-03-22 15:29:53 +08:00
parent b6652624e3
commit b9248498eb
2 changed files with 8 additions and 1 deletions

View File

@ -51,7 +51,7 @@ cd hello-world
## 添加依赖
```bash
npm install --save @tmagic/editor @tmagic/form @tmagic/stage element-plus
npm install --save @tmagic/editor @tmagic/form @tmagic/stage @tmagic/design @tmagic/element-plus-adapter element-plus
```
## 注册组件
@ -66,13 +66,16 @@ import '@tmagic/form/dist/style.css';
import { createApp } from 'vue';
import ElementPlus from 'element-plus';
import TMagicDesign from '@tmagic/design';
import TMagicEditor from '@tmagic/editor';
import TMagicElementPlusAdapter from '@tmagic/element-plus-adapter';
import TMagicForm from '@tmagic/form';
import App from './App.vue';
createApp(App)
.use(ElementPlus)
.use(TMagicDesign, TMagicElementPlusAdapter)
.use(TMagicEditor)
.use(TMagicForm)
.mount('#app');
@ -157,6 +160,8 @@ api详情[modelValue](../../api/editor/props.md#modelvalue-v-model)
```ts
const value = ref({
type: 'app',
// 必须加上ID这个id可能是数据库生成的key也可以是生成的uuid
id: 1,
items: [],
});
```

View File

@ -97,6 +97,8 @@ npm run serve -- --port=8078
const value = ref({
type: 'app',
// 必须加上ID这个id可能是数据库生成的key也可以是生成的uuid
id: 1,
items: [],
});