升级各依赖包,内置ElementPlus

This commit is contained in:
zhangyiming 2020-12-03 09:27:36 +08:00
parent a111fcc574
commit a647a16b92
13 changed files with 924 additions and 9101 deletions

3
.gitignore vendored
View File

@ -1 +1,2 @@
/node_modules
/node_modules
/dist

View File

@ -1,3 +0,0 @@
{
"pluginsFile": "tests/e2e/plugins/index.js"
}

View File

@ -1,6 +0,0 @@
module.exports = {
preset: '@vue/cli-plugin-unit-jest/presets/typescript',
transform: {
'^.+\\.vue$': 'vue-jest'
}
}

9870
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -5,34 +5,28 @@
"scripts": {
"serve": "vite",
"build": "vite build",
"test:unit": "vue-cli-service test:unit",
"test:e2e": "vue-cli-service test:e2e",
"lint": "vue-cli-service lint"
},
"dependencies": {
"await-to-js": "^2.1.1",
"axios": "^0.21.0",
"vue": "^3.0.2",
"vue-class-component": "^8.0.0-0",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.0-0"
"element-plus": "^1.0.1-beta.2",
"vue": "^3.0.4",
"vue-class-component": "^8.0.0-rc.1",
"vue-router": "^4.0.0-rc.6",
"vuex": "^4.0.0-rc.2"
},
"devDependencies": {
"@types/jest": "^24.0.19",
"@types/node": "^14.14.8",
"@typescript-eslint/eslint-plugin": "^2.33.0",
"@typescript-eslint/parser": "^2.33.0",
"@vue/cli-plugin-e2e-cypress": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-unit-jest": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.2",
"@vue/compiler-sfc": "^3.0.4",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/eslint-config-typescript": "^5.0.2",
"@vue/test-utils": "^2.0.0-0",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
@ -42,7 +36,6 @@
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"typescript": "~3.9.3",
"vite": "^1.0.0-rc.9",
"vue-jest": "^5.0.0-0"
"vite": "^1.0.0-rc.13"
}
}
}

View File

@ -4,6 +4,10 @@ import router from './router'
import store from './store'
import EnclosureHttp from "./api/utils/core"
// 内置ElementPlus
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css'
// 导入公共样式
import "./assets/index.css"
@ -12,4 +16,4 @@ const app = createApp(App)
// 全局注册Axios
app.config.globalProperties.$http = new EnclosureHttp()
app.use(store).use(router).mount('#app')
app.use(store).use(router).use(ElementPlus).mount('#app')

View File

@ -5,17 +5,17 @@
</template>
<script lang="ts">
import { ref } from "vue"
import info, { ContextProps } from "../components/info.vue"
import { ref } from "vue";
import info, { ContextProps } from "../components/info.vue";
const contextInfo: ContextProps = {
userName: "admin",
passWord: "123456",
dynamicText: "登录",
}
};
export default {
mounted() {
// @ts-ignore
this.$http.request("get", "/getApi")
this.$http.request("get", "/getApi");
},
components: {
info,
@ -23,9 +23,9 @@ export default {
setup() {
return {
contextInfo,
}
};
},
}
};
</script>
<style scoped>

View File

@ -1,12 +0,0 @@
module.exports = {
plugins: [
'cypress'
],
env: {
mocha: true,
'cypress/globals': true
},
rules: {
strict: 'off'
}
}

View File

@ -1,25 +0,0 @@
/* eslint-disable arrow-body-style */
// https://docs.cypress.io/guides/guides/plugins-guide.html
// if you need a custom webpack configuration you can uncomment the following import
// and then use the `file:preprocessor` event
// as explained in the cypress docs
// https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples
// /* eslint-disable import/no-extraneous-dependencies, global-require */
// const webpack = require('@cypress/webpack-preprocessor')
module.exports = (on, config) => {
// on('file:preprocessor', webpack({
// webpackOptions: require('@vue/cli-service/webpack.config'),
// watchOptions: {}
// }))
return Object.assign({}, config, {
fixturesFolder: 'tests/e2e/fixtures',
integrationFolder: 'tests/e2e/specs',
screenshotsFolder: 'tests/e2e/screenshots',
videosFolder: 'tests/e2e/videos',
supportFile: 'tests/e2e/support/index.js'
})
}

View File

@ -1,8 +0,0 @@
// https://docs.cypress.io/api/introduction/api.html
describe('My First Test', () => {
it('Visits the app root url', () => {
cy.visit('/')
cy.contains('h1', 'Welcome to Your Vue.js + TypeScript App')
})
})

View File

@ -1,25 +0,0 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This is will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

View File

@ -1,20 +0,0 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
// Import commands.js using ES2015 syntax:
import './commands'
// Alternatively you can use CommonJS syntax:
// require('./commands')

View File

@ -1,12 +0,0 @@
import { shallowMount } from '@vue/test-utils'
import HelloWorld from '@/components/HelloWorld.vue'
describe('HelloWorld.vue', () => {
it('renders props.msg when passed', () => {
const msg = 'new message'
const wrapper = shallowMount(HelloWorld, {
props: { msg }
})
expect(wrapper.text()).toMatch(msg)
})
})