From b55159de3901122136ed364b8e04d678dde4ffca Mon Sep 17 00:00:00 2001 From: wally <18603454788@163.com> Date: Tue, 26 Oct 2021 14:54:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .eslintrc.js | 3 + package-lock.json | 8 ++ package.json | 11 +-- src/App.vue | 37 ++++++++++ src/apis/index.js | 14 ++++ src/components/device-edit.vue | 19 +++++ src/components/search-bar.vue | 31 ++++++++ src/main.js | 4 +- src/routers/index.js | 6 ++ src/store/device.js | 58 +++++++++++++++ src/store/index.js | 11 +++ src/store/user.js | 53 +++++++++++++ src/utils/axios.js | 21 +++++- src/views/device-create.vue | 8 +- src/views/device-list.vue | 131 ++++++++++++++++++++++++++++----- vite.config.js | 31 ++++---- 17 files changed, 396 insertions(+), 52 deletions(-) create mode 100644 src/components/device-edit.vue create mode 100644 src/components/search-bar.vue create mode 100644 src/store/device.js create mode 100644 src/store/index.js create mode 100644 src/store/user.js diff --git a/.env.development b/.env.development index 0000523..7e1746a 100644 --- a/.env.development +++ b/.env.development @@ -1 +1 @@ -API_URL=http://localhost:4001 +VITE_API_URL=http://localhost:4001 diff --git a/.eslintrc.js b/.eslintrc.js index 1773dfd..34af86d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -13,6 +13,9 @@ module.exports = { 'import/no-unresolved': 0, 'import/extensions': 0, 'vue/html-self-closing': 'off', + 'no-unused-expressions': 'off', + 'vue/no-mutating-props': 'off', + 'vue/no-multiple-template-root': 'off', 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', 'no-param-reassign': 'off', diff --git a/package-lock.json b/package-lock.json index 6c03e59..2414c72 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4443,6 +4443,14 @@ "@vue/devtools-api": "^6.0.0-beta.18" } }, + "vuex": { + "version": "4.0.2", + "resolved": "https://registry.nlark.com/vuex/download/vuex-4.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvuex%2Fdownload%2Fvuex-4.0.2.tgz", + "integrity": "sha1-+Jbb1b8qDpY/AMZ+m2EN50nMrMk=", + "requires": { + "@vue/devtools-api": "^6.0.0-beta.11" + } + }, "webpack-virtual-modules": { "version": "0.4.3", "resolved": "https://registry.nlark.com/webpack-virtual-modules/download/webpack-virtual-modules-0.4.3.tgz?cache=0&sync_timestamp=1620993523325&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwebpack-virtual-modules%2Fdownload%2Fwebpack-virtual-modules-0.4.3.tgz", diff --git a/package.json b/package.json index 46b7865..321193c 100644 --- a/package.json +++ b/package.json @@ -16,12 +16,15 @@ "element-plus": "^1.1.0-beta.21", "vue": "^3.2.16", "vue-router": "^4.0.12", - "windicss": "^3.1.9" + "vuex": "^4.0.2", + "windicss": "^3.1.9", + "@vitejs/plugin-vue": "^1.9.3", + "vite": "^2.6.4", + "vite-plugin-windicss": "^1.4.11" }, "devDependencies": { "@commitlint/cli": "^13.2.1", "@commitlint/config-angular": "^13.2.0", - "@vitejs/plugin-vue": "^1.9.3", "commitizen": "^4.2.4", "cz-conventional-changelog": "^3.3.0", "eslint": "^7.32.0", @@ -34,9 +37,7 @@ "lint-staged": "^11.2.3", "prettier": "^2.4.1", "unplugin-vue-components": "^0.15.6", - "vite": "^2.6.4", - "vite-plugin-linter": "^1.0.1", - "vite-plugin-windicss": "^1.4.11" + "vite-plugin-linter": "^1.0.1" }, "browserslist": [ "Android >= 4", diff --git a/src/App.vue b/src/App.vue index 7f8c10c..78ed659 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,8 +1,45 @@