chore: ⬆️ update deps

This commit is contained in:
bqy_fe 2021-08-12 23:39:42 +08:00
parent 8619c579d6
commit 5c0895ed73
11 changed files with 459 additions and 305 deletions

12
.vscode/settings.json vendored
View File

@ -112,18 +112,22 @@
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"[scss]": { "[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": false,
"source.fixAll.stylelint": true
}
}, },
"[markdown]": { "[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": true, "source.fixAll.eslint": true
"source.fixAll.stylelint": true
}, },
"[vue]": { "[vue]": {
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll.eslint": false "source.fixAll.eslint": false,
"source.fixAll.stylelint": true
} }
}, },
"i18n-ally.localesPaths": ["src/locales/lang"], "i18n-ally.localesPaths": ["src/locales/lang"],

View File

@ -1,6 +1,6 @@
# 基于 Vite2.x + Vue3.x + TypeScript H5 低代码平台 # 基于 Vite2.x + Vue3.x + TypeScript H5 低代码平台
### 只是一个简单的模板,感兴趣可以根据自己的需要调整 ### 只是一个简单的模板,感兴趣可以根据自己的需要调整, 在这里你可以看到 vue3 很多有趣的新特性和玩法。
[![license](https://img.shields.io/github/license/buqiyuan/vite-vue3-lowcode.svg)](LICENSE) [![license](https://img.shields.io/github/license/buqiyuan/vite-vue3-lowcode.svg)](LICENSE)

1
components.d.ts vendored
View File

@ -8,6 +8,7 @@ declare module 'vue' {
ElCol: typeof import('element-plus/es/el-col')['default'] ElCol: typeof import('element-plus/es/el-col')['default']
ElCollapse: typeof import('element-plus/es/el-collapse')['default'] ElCollapse: typeof import('element-plus/es/el-collapse')['default']
ElCollapseItem: typeof import('element-plus/es/el-collapse-item')['default'] ElCollapseItem: typeof import('element-plus/es/el-collapse-item')['default']
ElConfigProvider: typeof import('element-plus/es/el-config-provider')['default']
ElContainer: typeof import('element-plus/es/el-container')['default'] ElContainer: typeof import('element-plus/es/el-container')['default']
ElDialog: typeof import('element-plus/es/el-dialog')['default'] ElDialog: typeof import('element-plus/es/el-dialog')['default']
ElDropdown: typeof import('element-plus/es/el-dropdown')['default'] ElDropdown: typeof import('element-plus/es/el-dropdown')['default']

View File

@ -21,63 +21,63 @@
}, },
"dependencies": { "dependencies": {
"@vant/touch-emulator": "^1.3.2", "@vant/touch-emulator": "^1.3.2",
"@vueuse/core": "^5.2.0", "@vueuse/core": "^5.3.0",
"@vueuse/integrations": "^5.2.0", "@vueuse/integrations": "^5.3.0",
"animate.css": "^4.1.1", "animate.css": "^4.1.1",
"axios": "^0.21.1", "axios": "^0.21.1",
"dayjs": "^1.10.6", "dayjs": "^1.10.6",
"dexie": "^3.0.3", "dexie": "^3.0.3",
"element-plus": "1.0.2-beta.58", "element-plus": "1.0.2-beta.70",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"monaco-editor": "^0.26.1", "monaco-editor": "^0.26.1",
"nanoid": "^3.1.23", "nanoid": "^3.1.25",
"normalize.css": "^8.0.1", "normalize.css": "^8.0.1",
"nprogress": "^1.0.0-1", "nprogress": "^1.0.0-1",
"qrcode": "^1.4.4", "qrcode": "^1.4.4",
"qs": "^6.10.1", "qs": "^6.10.1",
"vant": "3.1.4", "vant": "3.2.0",
"vue": "3.1.5", "vue": "3.2.2",
"vue-router": "^4.0.10", "vue-router": "^4.0.11",
"vuedraggable": "^4.0.3", "vuedraggable": "^4.0.3",
"vuex": "^4.0.2" "vuex": "^4.0.2"
}, },
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^13.1.0", "@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0", "@commitlint/config-conventional": "^13.1.0",
"@types/node": "^16.4.2", "@types/node": "^16.6.0",
"@typescript-eslint/eslint-plugin": "^4.28.4", "@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.28.4", "@typescript-eslint/parser": "^4.29.1",
"@vitejs/plugin-legacy": "^1.4.4", "@vitejs/plugin-legacy": "^1.5.1",
"@vitejs/plugin-vue": "^1.2.5", "@vitejs/plugin-vue": "^1.4.0",
"@vitejs/plugin-vue-jsx": "^1.1.6", "@vitejs/plugin-vue-jsx": "^1.1.7",
"@vue/compiler-sfc": "3.1.5", "@vue/compiler-sfc": "3.2.2",
"commitizen": "^4.2.4", "commitizen": "^4.2.4",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0", "cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^6.3.0", "cz-customizable": "^6.3.0",
"eslint": "^7.31.0", "eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4", "eslint-plugin-import": "^2.24.0",
"eslint-plugin-prettier": "^3.4.0", "eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^7.14.0", "eslint-plugin-vue": "^7.16.0",
"gh-pages": "^3.2.3", "gh-pages": "^3.2.3",
"husky": "^7.0.1", "husky": "^7.0.1",
"lint-staged": "^11.1.1", "lint-staged": "^11.1.2",
"prettier": "^2.3.2", "prettier": "^2.3.2",
"pretty-quick": "^3.1.1", "pretty-quick": "^3.1.1",
"sass": "1.36.0", "sass": "1.37.5",
"stylelint": "^13.13.1", "stylelint": "^13.13.1",
"stylelint-config-prettier": "^8.0.2", "stylelint-config-prettier": "^8.0.2",
"stylelint-config-standard": "^22.0.0", "stylelint-config-standard": "^22.0.0",
"stylelint-order": "^4.1.0", "stylelint-order": "^4.1.0",
"typescript": "^4.3.5", "typescript": "^4.3.5",
"vite": "2.4.3", "vite": "2.4.4",
"vite-plugin-components": "^0.13.2", "vite-plugin-components": "^0.13.2",
"vite-plugin-style-import": "^1.0.1", "vite-plugin-style-import": "^1.1.1",
"vite-plugin-windicss": "^1.2.5", "vite-plugin-windicss": "^1.2.7",
"vue-eslint-parser": "^7.9.0", "vue-eslint-parser": "^7.10.0",
"vue-tsc": "^0.2.2", "vue-tsc": "^0.2.2",
"windicss": "^3.1.5" "windicss": "^3.1.7"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,11 +1,14 @@
<template> <template>
<router-view #="{ Component, route }"> <el-config-provider :locale="locale">
<component :is="Component" :key="route.path" /> <router-view #="{ Component, route }">
</router-view> <component :is="Component" :key="route.path" />
</router-view>
</el-config-provider>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { provide } from 'vue' import { provide } from 'vue'
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
import { initVisualData, injectKey, localKey } from '@/visual-editor/hooks/useVisualData' import { initVisualData, injectKey, localKey } from '@/visual-editor/hooks/useVisualData'
const visualData = initVisualData() const visualData = initVisualData()
@ -14,6 +17,8 @@ provide(injectKey, visualData)
const { jsonData } = visualData const { jsonData } = visualData
const locale = zhCn
window.addEventListener('beforeunload', () => { window.addEventListener('beforeunload', () => {
sessionStorage.setItem(localKey, JSON.stringify(jsonData)) sessionStorage.setItem(localKey, JSON.stringify(jsonData))
}) })

View File

@ -63,7 +63,7 @@ export default {
) )
}} }}
/> />
<Popup v-model={[state.showPicker, 'show']} position={'bottom'}> <Popup v-model={[state.showPicker, 'show']} position={'bottom'} teleport="body">
<DatetimePicker <DatetimePicker
ref={(el) => registerRef(el, block._vid)} ref={(el) => registerRef(el, block._vid)}
{...props} {...props}
@ -127,7 +127,7 @@ export default {
loading: createEditorSwitchProp({ label: '是否显示加载状态' }), loading: createEditorSwitchProp({ label: '是否显示加载状态' }),
showToolbar: createEditorSwitchProp({ label: '是否显示顶部栏' }), showToolbar: createEditorSwitchProp({ label: '是否显示顶部栏' }),
swipeDuration: createEditorInputProp({ label: '快速滑动时惯性滚动的时长单位ms' }), swipeDuration: createEditorInputProp({ label: '快速滑动时惯性滚动的时长单位ms' }),
visibleItemCount: createEditorInputNumberProp({ label: '可见的选项个数' }), visibleItemCount: createEditorInputNumberProp({ label: '可见的选项个数', defaultValue: 6 }),
placeholder: createEditorInputProp({ label: '占位符', defaultValue: '请选择' }), placeholder: createEditorInputProp({ label: '占位符', defaultValue: '请选择' }),
...createFieldProps() ...createFieldProps()
}, },

View File

@ -61,7 +61,7 @@ export default {
name: createEditorModelBindProp({ label: '字段绑定', defaultValue: '' }), name: createEditorModelBindProp({ label: '字段绑定', defaultValue: '' }),
label: createEditorInputProp({ label: '输入框左侧文本', defaultValue: '步进器' }), label: createEditorInputProp({ label: '输入框左侧文本', defaultValue: '步进器' }),
min: createEditorInputNumberProp({ label: '最小值', defaultValue: 0 }), min: createEditorInputNumberProp({ label: '最小值', defaultValue: 0 }),
max: createEditorInputNumberProp({ label: '最大值' }), max: createEditorInputNumberProp({ label: '最大值', defaultValue: 10 }),
...createFieldProps(), ...createFieldProps(),
allowEmpty: createEditorSwitchProp({ label: '是否允许输入的值为空', defaultValue: false }), allowEmpty: createEditorSwitchProp({ label: '是否允许输入的值为空', defaultValue: false }),
buttonSize: createEditorInputProp({ buttonSize: createEditorInputProp({

View File

@ -29,7 +29,7 @@
size="mini" size="mini"
icon="el-icon-video-play" icon="el-icon-video-play"
circle circle
class="flex-shrink-0" class="flex-shrink-0 !p-6px"
@click="runPreview" @click="runPreview"
/> />
</el-tooltip> </el-tooltip>

View File

@ -57,7 +57,7 @@ export default defineComponent({
height: 100%; height: 100%;
contain: layout; contain: layout;
> ::v-deep(.el-tabs__header) { > :deep(.el-tabs__header) {
margin-right: 0; margin-right: 0;
.el-tabs__item { .el-tabs__item {
@ -74,7 +74,7 @@ export default defineComponent({
} }
} }
> ::v-deep(.el-tabs__content) { > :deep(.el-tabs__content) {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }

View File

@ -63,6 +63,7 @@ import { cloneDeep } from 'lodash'
import { useGlobalProperties } from '@/hooks/useGlobalProperties' import { useGlobalProperties } from '@/hooks/useGlobalProperties'
import { useVisualData } from '@/visual-editor/hooks/useVisualData' import { useVisualData } from '@/visual-editor/hooks/useVisualData'
import { useModal } from '@/visual-editor/hooks/useModal' import { useModal } from '@/visual-editor/hooks/useModal'
import { generateNanoid } from '@/visual-editor/utils'
export default defineComponent({ export default defineComponent({
name: 'SimulatorEditor', name: 'SimulatorEditor',
@ -191,21 +192,20 @@ export default defineComponent({
onClick: () => { onClick: () => {
const index = parentBlocks.findIndex((item) => item._vid == block._vid) const index = parentBlocks.findIndex((item) => item._vid == block._vid)
if (index != -1) { if (index != -1) {
const setBlockVid = (block, index = -1) => { const setBlockVid = (block: VisualEditorBlockData) => {
block._vid = `vid_${Date.now() + index}` block._vid = `vid_${generateNanoid()}`
block.focus = false
const slots = block?.props?.slots || {} const slots = block?.props?.slots || {}
const slotKeys = Object.keys(slots) const slotKeys = Object.keys(slots)
if (slotKeys.length) { if (slotKeys.length) {
slotKeys.forEach((slotKey) => { slotKeys.forEach((slotKey) => {
slots[slotKey]?.children?.forEach((child, index) => slots[slotKey]?.children?.forEach((child) => setBlockVid(child))
setBlockVid(child, index)
)
}) })
} }
} }
const blockCopy = cloneDeep(parentBlocks[index]) const blockCopy = cloneDeep(parentBlocks[index])
setBlockVid(blockCopy) setBlockVid(blockCopy)
parentBlocks.splice(index, 0, blockCopy) parentBlocks.splice(index + 1, 0, blockCopy)
} }
} }
}} }}

666
yarn.lock

File diff suppressed because it is too large Load Diff