From ea986f3e6edebb4661cff5421bede8d2f8d10556 Mon Sep 17 00:00:00 2001
From: bqy_fe <1743369777@qq.com>
Date: Thu, 6 May 2021 00:35:05 +0800
Subject: [PATCH] feat: iframe preview
---
.env.production | 2 +-
.eslintrc.js | 56 +-
package.json | 18 +-
preview/App.vue | 19 +
preview/index.html | 13 +
preview/main.ts | 16 +
preview/router.ts | 15 +
preview/views/comp-render.tsx | 27 +
preview/views/preview.vue | 67 +
.../header => preview/views}/slot-item.vue | 0
.../base-widgets/number-range/index.tsx | 31 -
.../number-range/number-range.scss | 24 -
.../number-range/number-range.tsx | 30 -
src/packages/base-widgets/select/index.tsx | 37 -
.../components/common/simulator.vue | 3 +-
src/visual-editor/components/header/index.vue | 22 +-
.../components/header/preview.vue | 34 +-
src/visual-editor/utils/index.ts | 8 +
tsconfig.json | 2 +-
vite.config.ts | 18 +-
yarn.lock | 1982 +++++++++++++++--
21 files changed, 2060 insertions(+), 364 deletions(-)
create mode 100644 preview/App.vue
create mode 100644 preview/index.html
create mode 100644 preview/main.ts
create mode 100644 preview/router.ts
create mode 100644 preview/views/comp-render.tsx
create mode 100644 preview/views/preview.vue
rename {src/visual-editor/components/header => preview/views}/slot-item.vue (100%)
delete mode 100644 src/packages/base-widgets/number-range/index.tsx
delete mode 100644 src/packages/base-widgets/number-range/number-range.scss
delete mode 100644 src/packages/base-widgets/number-range/number-range.tsx
delete mode 100644 src/packages/base-widgets/select/index.tsx
create mode 100644 src/visual-editor/utils/index.ts
diff --git a/.env.production b/.env.production
index 6bbd5f7..beb3671 100644
--- a/.env.production
+++ b/.env.production
@@ -1,7 +1,7 @@
# 只在生产模式中被载入
# 网站前缀
-VITE_BASE_URL = /vite-vue3-lowcode
+VITE_BASE_URL = /vite-vue3-lowcode/
# 是否删除console
VITE_DROP_CONSOLE = true
diff --git a/.eslintrc.js b/.eslintrc.js
index 999fffb..fa5c4b8 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -23,38 +23,40 @@ module.exports = {
],
rules: {
'vue/require-default-prop': 'off',
+ 'no-unused-vars': 'off',
+ '@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
- '@typescript-eslint/explicit-module-boundary-types': 'off',
- '@typescript-eslint/no-unused-vars': [
- 'error',
- {
- argsIgnorePattern: '^_',
- varsIgnorePattern: '^_'
- }
- ],
- 'no-unused-vars': [
- 'error',
- {
- argsIgnorePattern: '^_',
- varsIgnorePattern: '^_'
- }
- ],
- 'vue/html-self-closing': [
- 'error',
- {
- html: {
- void: 'always',
- normal: 'never',
- component: 'always'
- },
- svg: 'always',
- math: 'always'
- }
- ]
+ '@typescript-eslint/explicit-module-boundary-types': 'off'
+ // '@typescript-eslint/no-unused-vars': [
+ // 'error',
+ // {
+ // argsIgnorePattern: '^_',
+ // varsIgnorePattern: '^_'
+ // }
+ // ],
+ // 'no-unused-vars': [
+ // 'error',
+ // {
+ // argsIgnorePattern: '^_',
+ // varsIgnorePattern: '^_'
+ // }
+ // ],
+ // 'vue/html-self-closing': [
+ // 'error',
+ // {
+ // html: {
+ // void: 'always',
+ // normal: 'never',
+ // component: 'always'
+ // },
+ // svg: 'always',
+ // math: 'always'
+ // }
+ // ]
},
settings: {}
}
diff --git a/package.json b/package.json
index 5e694f7..d1581a8 100644
--- a/package.json
+++ b/package.json
@@ -32,30 +32,30 @@
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@types/node": "^14.14.41",
- "@typescript-eslint/eslint-plugin": "^4.21.0",
- "@typescript-eslint/parser": "^4.21.0",
- "@vitejs/plugin-vue": "^1.2.1",
- "@vitejs/plugin-vue-jsx": "^1.1.3",
+ "@typescript-eslint/eslint-plugin": "^4.22.1",
+ "@typescript-eslint/parser": "^4.22.1",
+ "@vitejs/plugin-vue": "^1.2.2",
+ "@vitejs/plugin-vue-jsx": "^1.1.4",
"@vue/compiler-sfc": "^3.0.11",
"commitizen": "^4.2.3",
"cz-conventional-changelog": "^3.3.0",
"cz-customizable": "^6.3.0",
- "eslint": "^7.24.0",
+ "eslint": "^7.25.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
- "eslint-plugin-prettier": "^3.3.1",
- "eslint-plugin-vue": "^7.8.0",
+ "eslint-plugin-prettier": "^3.4.0",
+ "eslint-plugin-vue": "^7.9.0",
"husky": "^6.0.0",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"sass": "^1.32.10",
"typescript": "^4.2.4",
- "vite": "^2.2.3",
+ "vite": "^2.2.4",
"vite-plugin-components": "^0.8.4",
"vite-plugin-style-import": "^0.10.0",
"vite-plugin-windicss": "^0.14.6",
"vue-eslint-parser": "^7.6.0",
- "vue-tsc": "^0.0.25",
+ "vue-tsc": "^0.1.0",
"windicss": "^2.5.14"
},
"repository": {
diff --git a/preview/App.vue b/preview/App.vue
new file mode 100644
index 0000000..341525c
--- /dev/null
+++ b/preview/App.vue
@@ -0,0 +1,19 @@
+
+