diff --git a/README.zh-CN.md b/README.zh-CN.md index 0e15d8a4..0af0838d 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -161,7 +161,7 @@ cd vue-element-admin # 安装依赖 npm install -# 建议不要用 cnpm 安装 会有各种诡异的bug 可以通过如下操作解决 npm 下载速度慢的问题 +# 建议不要直接使用 cnpm 安装以来,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题 npm install --registry=https://registry.npm.taobao.org # 启动服务 diff --git a/jest.config.js b/jest.config.js index 1ce813e1..143cdc86 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,12 +1,9 @@ module.exports = { - verbose: true, moduleFileExtensions: ['js', 'jsx', 'json', 'vue'], - transformIgnorePatterns: [ - 'node_modules/(?!(babel-jest|jest-vue-preprocessor)/)' - ], transform: { '^.+\\.vue$': 'vue-jest', - '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': + 'jest-transform-stub', '^.+\\.jsx?$': 'babel-jest' }, moduleNameMapper: { diff --git a/package.json b/package.json index 72e92927..6802c9b5 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src", - "test:unit": "vue-cli-service test:unit", + "test:unit": "jest --clearCache && vue-cli-service test:unit", "test:ci": "npm run lint && npm run test:unit", "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml", "new": "plop" diff --git a/src/components/Sticky/index.vue b/src/components/Sticky/index.vue index fa165bc7..97ce0e96 100644 --- a/src/components/Sticky/index.vue +++ b/src/components/Sticky/index.vue @@ -40,14 +40,14 @@ export default { mounted() { this.height = this.$el.getBoundingClientRect().height window.addEventListener('scroll', this.handleScroll) - window.addEventListener('resize', this.handleReize) + window.addEventListener('resize', this.handleResize) }, activated() { this.handleScroll() }, destroyed() { window.removeEventListener('scroll', this.handleScroll) - window.removeEventListener('resize', this.handleReize) + window.removeEventListener('resize', this.handleResize) }, methods: { sticky() { @@ -81,7 +81,7 @@ export default { } this.handleReset() }, - handleReize() { + handleResize() { if (this.isSticky) { this.width = this.$el.getBoundingClientRect().width + 'px' } diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index a05c3b9c..284851e5 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -1,5 +1,5 @@