From ddd9d30e081ba334ea7c2779d7c6d7a5da4c2319 Mon Sep 17 00:00:00 2001 From: dingangang <dingangang@gmail.com> Date: Mon, 25 May 2020 17:13:00 +0800 Subject: [PATCH] Revert "merge master" --- README.es.md | 2 -- README.ja.md | 2 -- README.md | 2 -- README.zh-CN.md | 2 -- src/components/Tinymce/index.vue | 6 ++--- src/layout/components/Sidebar/Link.vue | 25 +++++++------------ src/layout/components/TagsView/ScrollPane.vue | 9 ------- src/layout/components/TagsView/index.vue | 5 +--- src/main.js | 4 +-- src/permission.js | 2 +- src/styles/element-ui.scss | 2 +- src/styles/element-variables.scss | 6 ++--- src/utils/index.js | 2 +- tests/unit/utils/parseTime.spec.js | 5 ---- 14 files changed, 20 insertions(+), 54 deletions(-) diff --git a/README.es.md b/README.es.md index 3e054ce9..396556f5 100644 --- a/README.es.md +++ b/README.es.md @@ -62,8 +62,6 @@ Vue Element Admin es una solución práctica basada en la nueva plataforma de de Necesita instalar [node](https://nodejs.org/) y [git](https://git-scm.com/) localmente. El proyecto es basado en [ES2015+](https://es6.ruanyifeng.com/), [vue](https://cn.vuejs.org/index.html), [vuex](https://vuex.vuejs.org/zh-cn/), [vue-router](https://router.vuejs.org/zh-cn/), [vue-cli](https://github.com/vuejs/vue-cli) , [axios](https://github.com/axios/axios) and [element-ui](https://github.com/ElemeFE/element), toda la solicitud de datos simulada se realiza a través de [Mock.js](https://github.com/nuysoft/Mock). Entendiendo y aprendiendo esto pudiera ayudarle con su proyecto. -[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox) - <p align="center"> <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png"> </p> diff --git a/README.ja.md b/README.ja.md index a20a4d71..0c49685b 100644 --- a/README.ja.md +++ b/README.ja.md @@ -59,8 +59,6 @@ **バグ修正や新規機能追加のissue と pull requestは大歓迎です。** -[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox) - <p align="center"> <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png"> </p> diff --git a/README.md b/README.md index 458ae970..a6a10447 100644 --- a/README.md +++ b/README.md @@ -62,8 +62,6 @@ English | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [Spa You need to install [node](https://nodejs.org/) and [git](https://git-scm.com/) locally. The project is based on [ES2015+](https://es6.ruanyifeng.com/), [vue](https://cn.vuejs.org/index.html), [vuex](https://vuex.vuejs.org/zh-cn/), [vue-router](https://router.vuejs.org/zh-cn/), [vue-cli](https://github.com/vuejs/vue-cli) , [axios](https://github.com/axios/axios) and [element-ui](https://github.com/ElemeFE/element), all request data is simulated using [Mock.js](https://github.com/nuysoft/Mock). Understanding and learning this knowledge in advance will greatly help the use of this project. -[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox) - <p align="center"> <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png"> </p> diff --git a/README.zh-CN.md b/README.zh-CN.md index e8424111..3df8b8ea 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -77,8 +77,6 @@ **如有问题请先看上述使用文档和文章,若不能满足,欢迎 issue 和 pr** -[](https://codesandbox.io/s/github/PanJiaChen/vue-element-admin/tree/CodeSandbox) - <p align="center"> <img width="900" src="https://wpimg.wallstcn.com/a5894c1b-f6af-456e-82df-1151da0839bf.png"> </p> diff --git a/src/components/Tinymce/index.vue b/src/components/Tinymce/index.vue index b3538c25..c0f486f0 100644 --- a/src/components/Tinymce/index.vue +++ b/src/components/Tinymce/index.vue @@ -148,9 +148,9 @@ export default { _this.fullscreen = e.state }) }, - // it will try to keep these URLs intact - // https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/ - // https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions + //it will try to keep these URLs intact + //https://www.tiny.cloud/docs-3x/reference/configuration/Configuration3x@convert_urls/ + //https://stackoverflow.com/questions/5196205/disable-tinymce-absolute-to-relative-url-conversions convert_urls: false // 整合七牛上传 // images_dataimg_filter(img) { diff --git a/src/layout/components/Sidebar/Link.vue b/src/layout/components/Sidebar/Link.vue index 530b3d5b..eb4dd107 100644 --- a/src/layout/components/Sidebar/Link.vue +++ b/src/layout/components/Sidebar/Link.vue @@ -1,5 +1,7 @@ + <template> - <component :is="type" v-bind="linkProps(to)"> + <!-- eslint-disable vue/require-component-is --> + <component v-bind="linkProps(to)"> <slot /> </component> </template> @@ -14,28 +16,19 @@ export default { required: true } }, - computed: { - isExternal() { - return isExternal(this.to) - }, - type() { - if (this.isExternal) { - return 'a' - } - return 'router-link' - } - }, methods: { - linkProps(to) { - if (this.isExternal) { + linkProps(url) { + if (isExternal(url)) { return { - href: to, + is: 'a', + href: url, target: '_blank', rel: 'noopener' } } return { - to: to + is: 'router-link', + to: url } } } diff --git a/src/layout/components/TagsView/ScrollPane.vue b/src/layout/components/TagsView/ScrollPane.vue index 34a7e55f..0ec76e72 100644 --- a/src/layout/components/TagsView/ScrollPane.vue +++ b/src/layout/components/TagsView/ScrollPane.vue @@ -19,21 +19,12 @@ export default { return this.$refs.scrollContainer.$refs.wrap } }, - mounted() { - this.scrollWrapper.addEventListener('scroll', this.emitScroll, true) - }, - beforeDestroy() { - this.scrollWrapper.removeEventListener('scroll', this.emitScroll) - }, methods: { handleScroll(e) { const eventDelta = e.wheelDelta || -e.deltaY * 40 const $scrollWrapper = this.scrollWrapper $scrollWrapper.scrollLeft = $scrollWrapper.scrollLeft + eventDelta / 4 }, - emitScroll() { - this.$emit('scroll') - }, moveToTarget(currentTag) { const $container = this.$refs.scrollContainer.$el const $containerWidth = $container.offsetWidth diff --git a/src/layout/components/TagsView/index.vue b/src/layout/components/TagsView/index.vue index d2a56e70..642b4f42 100644 --- a/src/layout/components/TagsView/index.vue +++ b/src/layout/components/TagsView/index.vue @@ -1,6 +1,6 @@ <template> <div id="tags-view-container" class="tags-view-container"> - <scroll-pane ref="scrollPane" class="tags-view-wrapper" @scroll="handleScroll"> + <scroll-pane ref="scrollPane" class="tags-view-wrapper"> <router-link v-for="tag in visitedViews" ref="tag" @@ -189,9 +189,6 @@ export default { }, closeMenu() { this.visible = false - }, - handleScroll() { - this.closeMenu() } } } diff --git a/src/main.js b/src/main.js index b5fa135d..1049d762 100644 --- a/src/main.js +++ b/src/main.js @@ -6,7 +6,6 @@ import 'normalize.css/normalize.css' // a modern alternative to CSS resets import Element from 'element-ui' import './styles/element-variables.scss' -import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖 import '@/styles/index.scss' // global css @@ -34,8 +33,7 @@ if (process.env.NODE_ENV === 'production') { } Vue.use(Element, { - size: Cookies.get('size') || 'medium', // set element-ui default size - locale: enLang // 如果使用中文,无需设置,请删除 + size: Cookies.get('size') || 'medium' // set element-ui default size }) // register global utility filters diff --git a/src/permission.js b/src/permission.js index ff5eaad2..750aeab6 100644 --- a/src/permission.js +++ b/src/permission.js @@ -24,7 +24,7 @@ router.beforeEach(async(to, from, next) => { if (to.path === '/login') { // if is logged in, redirect to the home page next({ path: '/' }) - NProgress.done() // hack: https://github.com/PanJiaChen/vue-element-admin/pull/2939 + NProgress.done() } else { // determine whether the user has obtained his permission roles through getInfo const hasRoles = store.getters.roles && store.getters.roles.length > 0 diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 49474de3..955d3cab 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -31,7 +31,7 @@ .fixed-width { .el-button--mini { padding: 7px 10px; - min-width: 60px; + width: 60px; } } diff --git a/src/styles/element-variables.scss b/src/styles/element-variables.scss index 5bdc4dad..30a0e6bc 100644 --- a/src/styles/element-variables.scss +++ b/src/styles/element-variables.scss @@ -6,7 +6,7 @@ /* theme color */ $--color-primary: #1890ff; $--color-success: #13ce66; -$--color-warning: #ffba00; +$--color-warning: #FFBA00; $--color-danger: #ff4949; // $--color-info: #1E1E1E; @@ -17,10 +17,10 @@ $--button-font-weight: 400; $--border-color-light: #dfe4ed; $--border-color-lighter: #e6ebf5; -$--table-border: 1px solid #dfe6ec; +$--table-border:1px solid#dfe6ec; /* icon font path, required */ -$--font-path: "~element-ui/lib/theme-chalk/fonts"; +$--font-path: '~element-ui/lib/theme-chalk/fonts'; @import "~element-ui/packages/theme-chalk/src/index"; diff --git a/src/utils/index.js b/src/utils/index.js index 96ee6e7f..eb760d5e 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -9,7 +9,7 @@ * @returns {string | null} */ export function parseTime(time, cFormat) { - if (arguments.length === 0 || !time) { + if (arguments.length === 0) { return null } const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}' diff --git a/tests/unit/utils/parseTime.spec.js b/tests/unit/utils/parseTime.spec.js index 3e138d00..bc61d1ac 100644 --- a/tests/unit/utils/parseTime.spec.js +++ b/tests/unit/utils/parseTime.spec.js @@ -1,5 +1,4 @@ import { parseTime } from '@/utils/index.js' - describe('Utils:parseTime', () => { const d = new Date('2018-07-13 17:54:01') // "2018-07-13 17:54:01" it('timestamp', () => { @@ -30,8 +29,4 @@ describe('Utils:parseTime', () => { it('empty argument', () => { expect(parseTime()).toBeNull() }) - - it('null', () => { - expect(parseTime(null)).toBeNull() - }) })