From cffc30afa3136c58ac5c48d2f521a3be403a1600 Mon Sep 17 00:00:00 2001 From: Soybean Date: Thu, 3 Aug 2023 23:59:00 +0800 Subject: [PATCH] chore(projects): correct word spell & eslint fix code --- .eslintrc.js | 3 ++- .vscode/settings.json | 14 ++++++++++- src/components/common/app-loading.vue | 4 +-- src/components/custom/count-to.vue | 4 +-- src/components/custom/svg-icon.vue | 4 +-- .../components/search-footer.vue | 5 +++- src/plugins/assets.ts | 4 ++- src/views/component/table/index.vue | 25 ++++++++++++++++--- 8 files changed, 49 insertions(+), 14 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d3459203..a47b0631 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -10,7 +10,8 @@ module.exports = { { files: ['*.vue'], rules: { - 'no-undef': 'off' // use tsc to check the ts code of the vue + 'no-undef': 'off', // use tsc to check the ts code of the vue + 'vue/no-setup-props-destructure': 'off' // wait to fix this rule } } ], diff --git a/.vscode/settings.json b/.vscode/settings.json index 63c8a8db..9cc38b1e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -16,7 +16,10 @@ ], "cSpell.words": [ "AMAP", + "antdesign", "antv", + "apacheecharts", + "areaspline", "bmapgl", "colord", "echarts", @@ -25,15 +28,24 @@ "iconify", "jsapi", "naiveui", + "Popconfirm", + "Posva", + "Shenzhen", "Sider", "tauri", "unocss", "unplugin", "vditor", + "VERCEL", + "Vite", + "vitejs", + "vuedraggable", "vueuse", "wangeditor", "wechat", - "xgplayer" + "xgplayer", + "yanbowe", + "ភាសាខ្មែរ" ], "editor.codeActionsOnSave": { "source.fixAll.eslint": true diff --git a/src/components/common/app-loading.vue b/src/components/common/app-loading.vue index 2666c986..f81875f7 100644 --- a/src/components/common/app-loading.vue +++ b/src/components/common/app-loading.vue @@ -4,7 +4,7 @@
(), { diff --git a/src/components/custom/svg-icon.vue b/src/components/custom/svg-icon.vue index 380baa69..500244a0 100644 --- a/src/components/custom/svg-icon.vue +++ b/src/components/custom/svg-icon.vue @@ -37,13 +37,13 @@ const bindAttrs = computed<{ class: string; style: string }>(() => ({ })); const symbolId = computed(() => { - const { VITE_ICON_LOCAL_PREFIX: preffix } = import.meta.env; + const { VITE_ICON_LOCAL_PREFIX: prefix } = import.meta.env; const defaultLocalIcon = 'no-icon'; const icon = props.localIcon || defaultLocalIcon; - return `#${preffix}-${icon}`; + return `#${prefix}-${icon}`; }); /** 渲染本地icon */ diff --git a/src/layouts/common/global-search/components/search-footer.vue b/src/layouts/common/global-search/components/search-footer.vue index aa76d37d..f198591a 100644 --- a/src/layouts/common/global-search/components/search-footer.vue +++ b/src/layouts/common/global-search/components/search-footer.vue @@ -22,6 +22,9 @@ defineOptions({ name: 'SearchFooter' }); diff --git a/src/plugins/assets.ts b/src/plugins/assets.ts index 013ba6d0..1de294ec 100644 --- a/src/plugins/assets.ts +++ b/src/plugins/assets.ts @@ -7,4 +7,6 @@ import 'virtual:svg-icons-register'; import '../styles/css/global.css'; /** import static assets: css, js , font and so on. - [引入静态资源,css、js和字体文件等] */ -export default function setupAssets() {} +export default function setupAssets() { + // +} diff --git a/src/views/component/table/index.vue b/src/views/component/table/index.vue index 4ac05131..838cdbc4 100644 --- a/src/views/component/table/index.vue +++ b/src/views/component/table/index.vue @@ -29,7 +29,7 @@ interface DataSource { const { loading, startLoading, endLoading, empty, setEmpty } = useLoadingEmpty(); -const columns: DataTableColumn[] = [ +const columns: DataTableColumn[] = [ { title: 'Name', key: 'name', @@ -49,13 +49,22 @@ const columns: DataTableColumn[] = [ key: 'action', title: 'Action', align: 'center', - render: () => { + render: row => { return ( - {}}> + { + handleEdit(row.name); + }} + > 编辑 - {}}> + { + handleDelete(row.name); + }} + > {{ default: () => '确认删除', trigger: () => 删除 @@ -99,6 +108,14 @@ function getEmptyDataSource() { }, 1000); } +function handleEdit(_name: string) { + // +} + +function handleDelete(_name: string) { + // +} + onMounted(() => { getDataSource(); });