feat: 添加了 element-plus

This commit is contained in:
谢泓 2022-07-15 10:02:40 +08:00
parent 15393967a3
commit 4c46021389
6 changed files with 1129 additions and 39 deletions

4
.husky/pre-commit Normal file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

View File

@ -4,6 +4,7 @@
"module": "esnext", "module": "esnext",
"baseUrl": "./", "baseUrl": "./",
"moduleResolution": "node", "moduleResolution": "node",
"jsx": "preserve",
"paths": { "paths": {
"@/*": [ "@/*": [
"src/*" "src/*"

View File

@ -11,6 +11,8 @@
"dependencies": { "dependencies": {
"axios": "^0.27.2", "axios": "^0.27.2",
"core-js": "^3.8.3", "core-js": "^3.8.3",
"element-plus": "1.3.0-beta.5",
"lint-staged": "13.0.3",
"vue": "^3.2.13", "vue": "^3.2.13",
"vue-router": "^4.0.3", "vue-router": "^4.0.3",
"vuex": "^4.0.0" "vuex": "^4.0.0"
@ -25,6 +27,7 @@
"@vue/cli-plugin-router": "~5.0.0", "@vue/cli-plugin-router": "~5.0.0",
"@vue/cli-plugin-vuex": "~5.0.0", "@vue/cli-plugin-vuex": "~5.0.0",
"@vue/cli-service": "~5.0.0", "@vue/cli-service": "~5.0.0",
"@vue/composition-api": "^1.1.0",
"@vue/eslint-config-standard": "^6.1.0", "@vue/eslint-config-standard": "^6.1.0",
"cz-customizable": "^6.3.0", "cz-customizable": "^6.3.0",
"eslint": "^7.32.0", "eslint": "^7.32.0",
@ -34,11 +37,19 @@
"eslint-plugin-vue": "^8.0.3", "eslint-plugin-vue": "^8.0.3",
"husky": "^7.0.1", "husky": "^7.0.1",
"sass": "^1.32.7", "sass": "^1.32.7",
"sass-loader": "^12.0.0" "sass-loader": "^12.0.0",
"unplugin-auto-import": "^0.9.3",
"unplugin-vue-components": "^0.21.1"
}, },
"config": { "config": {
"commitizen": { "commitizen": {
"path": "node_modules/cz-customizable" "path": "node_modules/cz-customizable"
} }
},
"lint-staged": {
"src/**/*.{js,vue}": [
"eslint --fix",
"git add"
]
} }
} }

View File

@ -1,9 +1,16 @@
<template> <template>
<nav> <nav>
<el-button>Default</el-button>
<el-button type="primary">Primary</el-button>
<el-button type="success">Success</el-button>
<el-button type="info">Info</el-button>
<el-button type="warning">Warning</el-button>
<el-button type="danger">Danger</el-button>
<el-button>中文</el-button>
<router-link to="/">Home</router-link> | <router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link> <router-link to="/about">About</router-link>
</nav> </nav>
<router-view/> <router-view />
</template> </template>
<style lang="scss"> <style lang="scss">

View File

@ -1,4 +1,19 @@
const { defineConfig } = require('@vue/cli-service') // const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({ // module.exports = defineConfig({
transpileDependencies: true // transpileDependencies: true
}) // })
const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const { ElementPlusResolver } = require('unplugin-vue-components/resolvers')
module.exports = {
configureWebpack: config => {
config.plugins.push(AutoImport({
resolvers: [ElementPlusResolver()],
}))
config.plugins.push(Components({
resolvers: [ElementPlusResolver()],
}))
},
}

1118
yarn.lock

File diff suppressed because it is too large Load Diff