diff --git a/.env.development b/.env.development index cfe99b3..d61b120 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,8 @@ # 只在开发模式中被载入 +# 网站标题 +VITE_APP_TITLE = H5低代码 + # 网站前缀 VITE_BASE_URL = / diff --git a/.env.production b/.env.production index beb3671..a8c4045 100644 --- a/.env.production +++ b/.env.production @@ -1,5 +1,8 @@ # 只在生产模式中被载入 +# 网站标题 +VITE_APP_TITLE = H5低代码 + # 网站前缀 VITE_BASE_URL = /vite-vue3-lowcode/ diff --git a/README.EN.md b/README.EN.md index d4b9649..93ee768 100644 --- a/README.EN.md +++ b/README.EN.md @@ -49,20 +49,22 @@ let propObj = { boolean: (config) => `createEditorSwitchProp(${JSON.stringify(config)})` } -$$('#props + table tr').reduce((prev, curr) => { - const children = curr.children - const key = children[0].textContent.replace(/-([a-z])/g, (all, i) => i.toUpperCase()) - const child3Text = children[3].textContent - const defaultValue = ['true', 'false'].includes(child3Text) - ? child3Text - : `'${child3Text == '-' ? '' : child3Text}'` - const value = (propObj[children[2].textContent] ?? propObj['string'])({ - label: `'${children[1].textContent}'`, - defaultValue - }).replaceAll('"', '') - prev[key] = value - return prev -}, {}) +JSON.stringify( + $$('#props + table tbody tr').reduce((prev, curr) => { + const children = curr.children + const key = children[0].textContent.replace(/-([a-z])/g, (all, i) => i.toUpperCase()) + const child3Text = children[3].textContent + const defaultValue = ['true', 'false'].includes(child3Text) + ? child3Text + : `'${child3Text == '-' ? '' : child3Text}'` + const value = (propObj[children[2].textContent] ?? propObj['string'])({ + label: `'${children[1].textContent}'`, + defaultValue + }).replaceAll('"', '') + prev[key] = value + return prev + }, {}) +).replaceAll('"', '') ``` ## Browser support diff --git a/README.md b/README.md index 323409e..959c6ba 100644 --- a/README.md +++ b/README.md @@ -56,20 +56,38 @@ let propObj = { boolean: (config) => `createEditorSwitchProp(${JSON.stringify(config)})` } -$$('#props + table tr').reduce((prev, curr) => { - const children = curr.children - const key = children[0].textContent.replace(/-([a-z])/g, (all, i) => i.toUpperCase()) - const child3Text = children[3].textContent - const defaultValue = ['true', 'false'].includes(child3Text) - ? child3Text - : `'${child3Text == '-' ? '' : child3Text}'` - const value = (propObj[children[2].textContent] ?? propObj['string'])({ - label: `'${children[1].textContent}'`, - defaultValue - }).replaceAll('"', '') - prev[key] = value - return prev -}, {}) +JSON.stringify( + $$('#props + table tbody tr').reduce((prev, curr) => { + const children = curr.children + const key = children[0].textContent.replace(/-([a-z])/g, (all, i) => i.toUpperCase()) + const child3Text = children[3].textContent + const defaultValue = ['true', 'false'].includes(child3Text) + ? child3Text + : `'${child3Text == '-' ? '' : child3Text}'` + const value = (propObj[children[2].textContent] ?? propObj['string'])({ + label: `'${children[1].textContent}'`, + defaultValue + }).replaceAll('"', '') + prev[key] = value + return prev + }, {}) +).replaceAll('"', '') +``` + +```javascript +// 在vant文档中 chrome控制台输入以下代码,快速生成组件事件 +JSON.stringify( + $$('#events + table tbody tr').reduce((prev, curr) => { + const children = curr.children + const event = { + label: children[1].textContent, + value: children[0].textContent + } + return prev.concat([event]) + }, []) +) + .replaceAll(/(? - Vite App + H5低代码
diff --git a/package.json b/package.json index b710ff0..acb29d5 100644 --- a/package.json +++ b/package.json @@ -27,15 +27,15 @@ "axios": "^0.21.1", "dayjs": "^1.10.5", "dexie": "^3.0.3", - "element-plus": "1.0.2-beta.52", + "element-plus": "1.0.2-beta.54", "lodash": "^4.17.21", "monaco-editor": "^0.25.2", "normalize.css": "^8.0.1", "nprogress": "^1.0.0-1", "qrcode": "^1.4.4", "qs": "^6.10.1", - "vant": "^3.1.0", - "vue": "3.1.2", + "vant": "^3.1.2", + "vue": "3.1.4", "vue-router": "^4.0.10", "vuedraggable": "^4.0.3", "vuex": "^4.0.2" @@ -43,24 +43,24 @@ "devDependencies": { "@commitlint/cli": "^12.1.4", "@commitlint/config-conventional": "^12.1.4", - "@types/node": "^15.12.4", - "@typescript-eslint/eslint-plugin": "^4.28.0", - "@typescript-eslint/parser": "^4.28.0", - "@vitejs/plugin-legacy": "^1.4.2", - "@vitejs/plugin-vue": "^1.2.3", - "@vitejs/plugin-vue-jsx": "^1.1.5", - "@vue/compiler-sfc": "3.1.2", + "@types/node": "^16.0.0", + "@typescript-eslint/eslint-plugin": "^4.28.1", + "@typescript-eslint/parser": "^4.28.1", + "@vitejs/plugin-legacy": "^1.4.3", + "@vitejs/plugin-vue": "^1.2.4", + "@vitejs/plugin-vue-jsx": "^1.1.6", + "@vue/compiler-sfc": "3.1.4", "commitizen": "^4.2.4", "cross-env": "^7.0.3", "cz-conventional-changelog": "^3.3.0", "cz-customizable": "^6.3.0", - "eslint": "^7.29.0", + "eslint": "^7.30.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-prettier": "^3.4.0", "eslint-plugin-vue": "^7.12.1", "gh-pages": "^3.2.3", - "husky": "^6.0.0", + "husky": "^7.0.0", "lint-staged": "^11.0.0", "prettier": "^2.3.2", "pretty-quick": "^3.1.1", @@ -69,14 +69,14 @@ "stylelint-config-prettier": "^8.0.2", "stylelint-config-standard": "^22.0.0", "stylelint-order": "^4.1.0", - "typescript": "^4.3.4", + "typescript": "^4.3.5", "vite": "2.3.8", - "vite-plugin-components": "^0.11.2", + "vite-plugin-components": "^0.12.0", "vite-plugin-style-import": "^1.0.1", - "vite-plugin-windicss": "^1.1.1", - "vue-eslint-parser": "^7.6.0", + "vite-plugin-windicss": "^1.2.0", + "vue-eslint-parser": "^7.7.2", "vue-tsc": "^0.2.0", - "windicss": "^3.1.3" + "windicss": "^3.1.4" }, "repository": { "type": "git", diff --git a/preview/views/preview.vue b/preview/views/preview.vue index 2203e32..f5fd4d1 100644 --- a/preview/views/preview.vue +++ b/preview/views/preview.vue @@ -1,14 +1,14 @@ @@ -69,6 +69,8 @@ export default defineComponent({ return { ...toRefs(state), + actions: jsonData.actions, + models: jsonData.models, visualConfig } } diff --git a/preview/views/slot-item.vue b/preview/views/slot-item.vue index e583951..33b3cfd 100644 --- a/preview/views/slot-item.vue +++ b/preview/views/slot-item.vue @@ -1,17 +1,17 @@