diff --git a/README.md b/README.md index 3b93f971..360407c9 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ English | [简体中文](./README.zh-CN.md) | [日本語](./README.ja.md) | [Spa ## Introduction -[vue-element-admin](https://panjiachen.github.io/vue-element-admin) is a production-ready front-end solution for admin interfaces. It based on [vue](https://github.com/vuejs/vue) and use the UI Toolkit [element-ui](https://github.com/ElemeFE/element). +[vue-element-admin](https://panjiachen.github.io/vue-element-admin) is a production-ready front-end solution for admin interfaces. It is based on [vue](https://github.com/vuejs/vue) and uses the UI Toolkit [element-ui](https://github.com/ElemeFE/element). -It is a magical vue admin based on the newest development stack of vue, built-in i18n solution, typical templates for enterprise applications, lots of awesome features. It helps you build a large complex Single-Page Applications. I believe whatever your needs are, this project will help you. +[vue-element-admin](https://panjiachen.github.io/vue-element-admin) is based on the newest development stack of vue and it has a built-in i18n solution, typical templates for enterprise applications, and lots of awesome features. It helps you build large and complex Single-Page Applications. I believe whatever your needs are, this project will help you. - [Preview](https://panjiachen.github.io/vue-element-admin) diff --git a/plop-templates/store/index.hbs b/plop-templates/store/index.hbs new file mode 100644 index 00000000..4f8e2dc0 --- /dev/null +++ b/plop-templates/store/index.hbs @@ -0,0 +1,16 @@ +{{#if state}} +const state = {} +{{/if}} + +{{#if mutations}} +const mutations = {} +{{/if}} + +{{#if actions}} +const actions = {} +{{/if}} + +export default { + namespaced: true, + {{options}} +} diff --git a/plop-templates/store/prompt.js b/plop-templates/store/prompt.js new file mode 100644 index 00000000..bcbc11d1 --- /dev/null +++ b/plop-templates/store/prompt.js @@ -0,0 +1,62 @@ +const { notEmpty } = require('../utils.js') + +module.exports = { + description: 'generate store', + prompts: [{ + type: 'input', + name: 'name', + message: 'store name please', + validate: notEmpty('name') + }, + { + type: 'checkbox', + name: 'blocks', + message: 'Blocks:', + choices: [{ + name: 'state', + value: 'state', + checked: true + }, + { + name: 'mutations', + value: 'mutations', + checked: true + }, + { + name: 'actions', + value: 'actions', + checked: true + } + ], + validate(value) { + if (!value.includes('state') || !value.includes('mutations')) { + return 'store require at least state and mutations' + } + return true + } + } + ], + actions(data) { + const name = '{{name}}' + const { blocks } = data + const options = ['state', 'mutations'] + const joinFlag = `, + ` + if (blocks.length === 3) { + options.push('actions') + } + + const actions = [{ + type: 'add', + path: `src/store/modules/${name}.js`, + templateFile: 'plop-templates/store/index.hbs', + data: { + options: options.join(joinFlag), + state: blocks.includes('state'), + mutations: blocks.includes('mutations'), + actions: blocks.includes('actions') + } + }] + return actions + } +} diff --git a/plopfile.js b/plopfile.js index 9f3147e2..57387bf1 100644 --- a/plopfile.js +++ b/plopfile.js @@ -1,7 +1,9 @@ const viewGenerator = require('./plop-templates/view/prompt') const componentGenerator = require('./plop-templates/component/prompt') +const storeGenerator = require('./plop-templates/store/prompt.js') module.exports = function(plop) { plop.setGenerator('view', viewGenerator) plop.setGenerator('component', componentGenerator) + plop.setGenerator('store', storeGenerator) } diff --git a/src/components/MarkdownEditor/index.vue b/src/components/MarkdownEditor/index.vue index 3d6794b5..1a8a01ee 100644 --- a/src/components/MarkdownEditor/index.vue +++ b/src/components/MarkdownEditor/index.vue @@ -12,7 +12,7 @@ import Editor from 'tui-editor' import defaultOptions from './default-options' export default { - name: 'MarddownEditor', + name: 'MarkdownEditor', props: { value: { type: String, diff --git a/src/components/Share/DropdownMenu.vue b/src/components/Share/DropdownMenu.vue index 8ad8e56e..d194a517 100644 --- a/src/components/Share/DropdownMenu.vue +++ b/src/components/Share/DropdownMenu.vue @@ -44,6 +44,7 @@ $t: .1s; width: 250px; position: relative; z-index: 1; + height: auto!important; &-title { width: 100%; display: block; @@ -65,10 +66,12 @@ $t: .1s; position: absolute; width: 100%; background: #e0e0e0; + color: #000; line-height: 60px; height: 60px; cursor: pointer; - font-size: 20px; + font-size: 18px; + overflow: hidden; opacity: 1; transition: transform 0.28s ease; &:hover { @@ -90,7 +93,7 @@ $t: .1s; .share-dropdown-menu-item { @for $i from 1 through $n { &:nth-of-type(#{$i}) { - transition-delay: ($n - $i)*$t; + transition-delay: ($n - $i)*$t; transform: translate3d(0, ($i - 1)*60px, 0); } } diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss index 9581d56a..955d3cab 100644 --- a/src/styles/element-ui.scss +++ b/src/styles/element-ui.scss @@ -77,3 +77,8 @@ .el-range-editor.el-input__inner { display: inline-flex !important; } + +// to fix el-date-picker css style +.el-range-separator { + box-sizing: content-box; +} diff --git a/src/views/documentation/index.vue b/src/views/documentation/index.vue index 6f69cf42..d3f77468 100644 --- a/src/views/documentation/index.vue +++ b/src/views/documentation/index.vue @@ -1,26 +1,10 @@ @@ -53,8 +37,10 @@ export default { margin: 50px; display: flex; flex-wrap: wrap; + justify-content: space-evenly; + .document-btn { - margin-left: 50px; + flex-shrink: 0; display: block; cursor: pointer; background: black; diff --git a/src/views/excel/export-excel.vue b/src/views/excel/export-excel.vue index b33ec828..92df140a 100644 --- a/src/views/excel/export-excel.vue +++ b/src/views/excel/export-excel.vue @@ -13,7 +13,7 @@ - +