Skip to content

Commit 4f4d69f

Browse files
author
shangbin
committed
update: readme
1 parent 1367236 commit 4f4d69f

File tree

2 files changed

+16
-99
lines changed

2 files changed

+16
-99
lines changed

README.md

Lines changed: 12 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,24 @@
1-
# VCC
1+
# VCC 3
22

3-
VCC(Vue Compontent Creator)是Low Code Generator中独立的Vue组件代码编辑器。可以独立运行。
3+
VCC(Vue Compontent Creator)是 Low Code Generator 中独立的 Vue 组件代码编辑器。可以独立运行。当前你看到的是基于 Vue3 的 VCC 3 版本
44

5-
**通过它可以通过拖拽快速完成Vue组件代码骨架的搭建。详见后文视频介绍链接。**
5+
**通过它可以通过拖拽快速完成 Vue 组件代码骨架的搭建。详见后文视频介绍链接。**
66

7-
> 点击这里快速预览效果:[https://vcc.sahadev.tech/](https://vcc.sahadev.tech/) 当前已经升级至Vue3 + Vite。
7+
> 点击这里快速预览效果:[https://vcc3.sahadev.tech/](https://vcc3.sahadev.tech/) 当前已经升级至 Vue3 + Vite。
88
99
#### 使用示例
10-
##### 示例1
11-
直接在html中引用:
12-
```html
13-
<meta charset="utf-8">
14-
<title>vcc demo</title>
15-
<script src="https://unpkg.com/vue"></script>
16-
<!-- 引入样式 -->
17-
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
18-
<!-- 引入组件库 -->
19-
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
20-
<!-- 必须通过这种方式引入 -->
21-
<script src="https://static.imonkey.xueersi.com/vcc/vcc.umd.min.js"></script>
22-
23-
24-
<div id="app">
25-
<vcc :initCodeEntity="codeStructure" @updateCodeEntity="onCodeUpdate"></vcc>
26-
</div>
27-
28-
<script>
29-
// 以这样一段结构初始化VCC组件
30-
const initCodeStr = '{"template":{"lc_id":"root","__children":[{"div":{"class":"container","style":"min-height: 100%; padding-bottom: 100px;","lc_id":"container","__text__":"Hello,欢迎使用LCG,请往此区域拖拽组件","__children":[{"el-button":{"lc-mark":"","type":"danger","lc_id":"COAAYXizyI","__children":[],"__text__":"危险按钮","@click":"onButtonClick","size":"small"}}]}}]}}'
31-
new Vue({
32-
components: {
33-
vcc: vcc
34-
},
35-
data() {
36-
return {
37-
codeStructure: JSON.parse(initCodeStr),
38-
}
39-
},
40-
methods: {
41-
onCodeUpdate(newCodeEntity) {
42-
// 编辑后新的代码结构
43-
}
44-
}
45-
}).$mount('#app')
46-
</script>
47-
```
48-
49-
##### 示例2
50-
在Vue文件中引用:
51-
```vue
52-
<template>
53-
<vcc :initCodeEntity="codeStructure" @updateCodeEntity="onCodeUpdate"></vcc>
54-
</template>
55-
56-
<script>
57-
// 以这样一段结构初始化VCC组件
58-
const initCodeStr = '{"template":{"lc_id":"root","__children":[{"div":{"class":"container","style":"min-height: 100%; padding-bottom: 100px;","lc_id":"container","__text__":"Hello,欢迎使用LCG,请往此区域拖拽组件","__children":[{"el-button":{"lc-mark":"","type":"danger","lc_id":"COAAYXizyI","__children":[],"__text__":"危险按钮","@click":"onButtonClick","size":"small"}}]}}]}}'
59-
60-
export default {
61-
data() {
62-
return {
63-
codeStructure: JSON.parse(initCodeStr),
64-
}
65-
},
66-
methods: {
67-
onCodeUpdate(newCodeEntity) {
68-
// 编辑后新的代码结构,可以进行保存
69-
}
70-
}
71-
}
72-
</script>
73-
```
74-
注意不需要专门在components引入,而需要在index.html通过script引入(像示例1的引入方式)。这是因为VCC里面的组件采用了分包加载策略,子包依赖主包的相对路径。
75-
76-
另外还需要将Vue变为全局可访问的,例如:
77-
```js
78-
import Vue from "vue";
79-
import ElementUI from "element-ui";
80-
import "element-ui/lib/theme-chalk/index.css";
81-
82-
import APP from "./App.vue";
83-
84-
Vue.use(ElementUI);
8510

86-
// 内部需要同样配置的全局Vue
87-
self.Vue = Vue;
88-
89-
new Vue({
90-
el: "#app",
91-
render: (h) => h(APP),
92-
});
93-
94-
```
95-
96-
注意ElementUI组件也是需要项目中安装好的。
11+
请移步至使用Demo:[https://github.com/sahadev/vcc3-use-demo](https://github.com/sahadev/vcc3-use-demo)
9712
## 本地如何运行此项目
9813

9914
首先进行安装:
15+
10016
```sh
10117
npm i
10218
```
10319

10420
再进行启动(Vite):
21+
10522
```
10623
npm run dev
10724
```
@@ -110,9 +27,9 @@ npm run dev
11027

11128
## 使用介绍
11229

113-
此前在B站上录了两段视频。可以通过这两段视频简单了解如何使用它:
114-
[拖拽式Vue组件代码生成平台(LCG)介绍视频-哔哩哔哩】https://b23.tv/FInuZ8](https://b23.tv/FInuZ8)
115-
[LCG近期功能更新介绍-哔哩哔哩】https://b23.tv/SAHwVq](https://b23.tv/SAHwVq)
30+
此前在 B 站上录了两段视频。可以通过这两段视频简单了解如何使用它:
31+
[拖拽式 Vue 组件代码生成平台(LCG)介绍视频-哔哩哔哩】https://b23.tv/FInuZ8](https://b23.tv/FInuZ8)
32+
[LCG 近期功能更新介绍-哔哩哔哩】https://b23.tv/SAHwVq](https://b23.tv/SAHwVq)
11633

11734
## 贡献
11835

@@ -138,6 +55,6 @@ npm run dev
13855

13956
<img width="300" src="https://static.imonkey.xueersi.com/vcc/wechat_group.jpg">
14057

141-
如果遇到群二维码过期的情况,可以加我微信:SAHADEV-smile,我拉你入群。加我微信时请备注VCC
58+
如果遇到群二维码过期的情况,可以加我微信:SAHADEV-smile,我拉你入群。加我微信时请备注 VCC
14259

143-
另外我也特别希望可以和大家一起做这个项目。这个项目目前主要面对的是前端开发者。后期可以面向后端开发者与产品与UE
60+
另外我也特别希望可以和大家一起做这个项目。这个项目目前主要面对的是前端开发者。后期可以面向后端开发者与产品与 UE

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"name": "lcg-vcc",
2+
"name": "lcg-vcc3",
33
"description": "Low Code Generator -> Vue Component Creater",
44
"version": "0.5.3",
55
"private": false,
66
"keywords": [
77
"low-code",
88
"editor"
99
],
10-
"main": "./dist/vcc.umd.min.js",
10+
"main": "./dist/vcc3.umd.min.js",
1111
"scripts": {
1212
"dev": "vite --port 9818",
1313
"serve": "vite --port 9818",
1414
"build:release": "vite build --base=https://static.imonkey.xueersi.com/vcc3/",
15-
"build": "vue-cli-service build --report --target lib --name vcc './src/components-v2/VCC.vue'",
16-
"build:win": "vue-cli-service build --report --target lib --name vcc ./src/components-v2/VCC.vue && node ./src/script/distClear.js",
15+
"build": "vue-cli-service build --report --target lib --name vcc3 './src/components-v2/VCC.vue'",
16+
"build:win": "vue-cli-service build --report --target lib --name vcc3 ./src/components-v2/VCC.vue && node ./src/script/distClear.js",
1717
"compileAndbuild:dev": "npm run compileComponent && vue-cli-service build",
1818
"lint": "vue-cli-service lint",
1919
"build:prod": "vue-cli-service build --mode production",

0 commit comments

Comments
 (0)