Skip to content

Commit c24d91b

Browse files
committed
同步代码
1 parent bdd0056 commit c24d91b

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ module.exports = {
1111
withDefaults: "readonly"
1212
},
1313
rules: {
14-
"@typescript-eslint/no-explicit-any": "off", // ts:允许用any
14+
"@typescript-eslint/no-explicit-any": "off", // ts:允许用any
1515
"@typescript-eslint/no-useless-constructor": "error", // ts:不允许使用未定位类型自动转为any
1616
"@typescript-eslint/no-var-requires": "off", // ts:是否允许使用var
1717
"@typescript-eslint/no-non-null-assertion": "off", // ts:非空赋值
1818
"@typescript-eslint/explicit-module-boundary-types": "off", // ts:是否需要显式定义函数将返回什么类型
1919
"@typescript-eslint/ban-ts-comment": "off", // ts: 禁止ts注释
2020
"@typescript-eslint/no-unused-vars": "off", // ts:允许定义未引用使用的变量
21-
"vue/multi-word-component-names": ["error", { ignores: ["index", "App"] }], // vue:多词组件名称
21+
"vue/multi-word-component-names": ["off", { ignores: ["index", "App"] }], // vue:多词组件名称
2222
"vue/comment-directive": ["off", { reportUnusedDisableDirectives: false }], // vue:允许在标签中写 HTML 注释。
2323
"vue/no-deprecated-slot-attribute": "off", // 允许使用slot
2424
"vue/valid-v-slot": "off",

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# dependencies
1111
/node_modules
12-
src/common/mars2d-sdk/dist/plugins/
12+
packages/mars2d/dist/plugins/
1313
mars2d-*src.*
1414

1515

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@
44
"description": "在Vue3技术栈下的Mars2D平台 基础项目",
55
"scripts": {
66
"dev": "vite",
7-
"serve": "npm run clean-cache && vite",
7+
"serve": "npm run clean-cache && vite --host",
88
"clean-cache": "rimraf node_modules/.cache/ && rimraf node_modules/.vite",
99
"clean-lib": "rimraf node_modules",
1010
"preview": "vite preview",
1111
"build": "npm run lint && vite build",
12-
"lint": "eslint ./src/**/*.{js,jsx,vue,ts,tsx} --fix && vue-tsc --noEmit"
12+
"serve:dist": "http-server ./dist",
13+
"lint": "vue-tsc --noEmit --skipLibCheck && npm run eslint",
14+
"eslint": "eslint ./src/**/*.{js,jsx,vue,ts,tsx} --fix"
1315
},
1416
"dependencies": {
1517
"@icon-park/vue-next": "^1.3.6",
1618
"@turf/turf": "^6.5.0",
17-
"ant-design-vue": "3.0.0-beta.13",
19+
"ant-design-vue": "^3.2.5",
1820
"axios": "^0.25.0",
1921
"core-js": "^3.20.3",
2022
"echarts": "^5.2.2",
@@ -23,10 +25,10 @@
2325
"leaflet": "^1.8.0",
2426
"localforage": "^1.10.0",
2527
"mapv": "^2.0.62",
28+
"mars2d": "^3.1.0",
2629
"mars2d-echarts": "^3.1.0",
2730
"mars2d-esri": "^3.1.0",
2831
"mars2d-mapv": "^3.1.0",
29-
"mars2d": "^3.1.0",
3032
"nprogress": "^0.2.0",
3133
"uuid": "^8.3.2",
3234
"vue": "^3.2.31",
@@ -36,16 +38,20 @@
3638
"devDependencies": {
3739
"@types/leaflet": "^1.7.1",
3840
"@types/node": "^17.0.21",
41+
"@typescript-eslint/eslint-plugin": "^5.26.0",
3942
"@vitejs/plugin-vue": "^2.1.0",
4043
"@vue/eslint-config-typescript": "^10.0.0",
4144
"consola": "^2.15.3",
45+
"eslint": "^7.32.0",
4246
"eslint-config-standard": "^16.0.3",
4347
"eslint-plugin-import": "^2.25.4",
4448
"eslint-plugin-node": "^11.1.0",
4549
"eslint-plugin-promise": "^5.2.0",
4650
"eslint-plugin-vue": "^8.3.0",
4751
"fs-extra": "^10.0.0",
52+
"http-server": "^14.1.0",
4853
"less": "^4.1.2",
54+
"prettier": "^2.6.2",
4955
"rollup-plugin-external-globals": "^0.6.1",
5056
"serve-static": "^1.14.2",
5157
"standard": "^16.0.4",

src/components/mars-work/mars2d-map.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ onBeforeUnmount(() => {
6565
map.destroy()
6666
map = null
6767
}
68+
console.log("map销毁完成", map)
6869
})
6970
</script>
7071

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
"@mars/*": ["src/*"]
2727
}
2828
},
29-
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
29+
"vueCompilerOptions": {
30+
"experimentalDisableTemplateSupport": true
31+
},
32+
"include": ["packages/**/*.ts", "src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
3033
"exclude": ["node_modules", "src/**/*.js", "dist"]
3134
}

vite.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { defineConfig, loadEnv } from "vite"
44
import vue from "@vitejs/plugin-vue"
55
import eslintPlugin from "vite-plugin-eslint"
66
import { createStyleImportPlugin, AndDesignVueResolve } from "vite-plugin-style-import"
7-
import externalGlobals from "rollup-plugin-external-globals"
87

98
export default ({ mode }: ConfigEnv) => {
109
const root = process.cwd()
@@ -60,7 +59,7 @@ export default ({ mode }: ConfigEnv) => {
6059
sourcemap: false,
6160
// 自定义rollup-commonjs插件选项
6261
commonjsOptions: {
63-
include: /node_modules|src\/common/
62+
include: /node_modules|packages|src\/common/
6463
},
6564
// 自定义底层的 Rollup 打包配置
6665
rollupOptions: {

0 commit comments

Comments
 (0)