Compare commits
15 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
1df59cc4b6 | ||
|
312a2ca8ed | ||
|
f3733c0b37 | ||
|
0ef14ff5c6 | ||
|
c57c6045c9 | ||
|
fe190b6188 | ||
|
48a966fe1c | ||
|
63d39727ac | ||
|
1e0b9c0055 | ||
|
5f20bfc780 | ||
|
8851a68066 | ||
|
878628b0ed | ||
|
e254fc6c1a | ||
|
513eb66d97 | ||
|
62e1c851c8 |
@@ -38,6 +38,8 @@ It is a magical vue admin based on the newest development stack of vue, built-in
|
|||||||
|
|
||||||
- [Donate](https://panjiachen.github.io/vue-element-admin-site/donate/)
|
- [Donate](https://panjiachen.github.io/vue-element-admin-site/donate/)
|
||||||
|
|
||||||
|
- [Gitee](https://panjiachen.gitee.io/vue-element-admin/) 国内用户可访问该地址在线预览
|
||||||
|
|
||||||
**This project is positioned as a background integration solution and is not suitable for secondary development as a basic template.**
|
**This project is positioned as a background integration solution and is not suitable for secondary development as a basic template.**
|
||||||
|
|
||||||
- Base template recommends using: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
- Base template recommends using: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
||||||
|
@@ -36,6 +36,8 @@
|
|||||||
|
|
||||||
- [Donate](https://panjiachen.github.io/vue-element-admin-site/zh/donate/)
|
- [Donate](https://panjiachen.github.io/vue-element-admin-site/zh/donate/)
|
||||||
|
|
||||||
|
- [Gitee](https://panjiachen.gitee.io/vue-element-admin/) 国内用户可访问该地址在线预览
|
||||||
|
|
||||||
**本项目的定位是后台集成方案,不适合当基础模板来开发。**
|
**本项目的定位是后台集成方案,不适合当基础模板来开发。**
|
||||||
- 模板建议使用: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
- 模板建议使用: [vueAdmin-template](https://github.com/PanJiaChen/vueAdmin-template)
|
||||||
- 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
- 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin)
|
||||||
@@ -51,7 +53,8 @@
|
|||||||
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
|
- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板)](https://juejin.im/post/595b4d776fb9a06bbe7dba56)
|
||||||
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
|
- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836)
|
||||||
- [手摸手,带你优雅的使用 icon](https://juejin.im/post/59bb864b5188257e7a427c09)
|
- [手摸手,带你优雅的使用 icon](https://juejin.im/post/59bb864b5188257e7a427c09)
|
||||||
|
- [手摸手,带你用合理的姿势使用webpack4(上)](https://juejin.im/post/5b56909a518825195f499806)
|
||||||
|
- [手摸手,带你用合理的姿势使用webpack4(下)](https://juejin.im/post/5b5d6d6f6fb9a04fea58aabc)
|
||||||
|
|
||||||
或者加入该群主 **[圈子](https://jianshiapp.com/circles/1209)** 楼主会经常分享一些技术相关的东西
|
或者加入该群主 **[圈子](https://jianshiapp.com/circles/1209)** 楼主会经常分享一些技术相关的东西
|
||||||
|
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vue-element-admin",
|
"name": "vue-element-admin",
|
||||||
"version": "3.7.2",
|
"version": "3.7.3",
|
||||||
"description": "A magical vue admin. Typical templates for enterprise applications. Newest development stack of vue. Lots of awesome features",
|
"description": "A magical vue admin. Typical templates for enterprise applications. Newest development stack of vue. Lots of awesome features",
|
||||||
"author": "Pan <panfree23@gmail.com>",
|
"author": "Pan <panfree23@gmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
@@ -35,7 +35,7 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss" >
|
<style rel="stylesheet/scss" lang="scss" >
|
||||||
$n: 6; //和items.length 相同
|
$n: 8; //和items.length 相同
|
||||||
$t: .1s;
|
$t: .1s;
|
||||||
.share-dropdown-menu {
|
.share-dropdown-menu {
|
||||||
width: 250px;
|
width: 250px;
|
||||||
|
@@ -23,6 +23,7 @@ export default {
|
|||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* Mallki */
|
/* Mallki */
|
||||||
|
|
||||||
.link--mallki {
|
.link--mallki {
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
color: #4dd9d5;
|
color: #4dd9d5;
|
||||||
@@ -109,5 +110,4 @@ display: inline-block;
|
|||||||
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
-webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
||||||
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<div class="upload-container">
|
<div class="upload-container">
|
||||||
<el-button icon='el-icon-upload' size="mini" :style="{background:color,borderColor:color}" @click=" dialogVisible=true" type="primary">上传图片
|
<el-button icon='el-icon-upload' size="mini" :style="{background:color,borderColor:color}" @click=" dialogVisible=true" type="primary">上传图片
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-dialog append-to-body :visible.sync="dialogVisible">
|
<el-dialog :visible.sync="dialogVisible">
|
||||||
<el-upload class="editor-slide-upload" action="https://httpbin.org/post" :multiple="true" :file-list="fileList" :show-file-list="true"
|
<el-upload class="editor-slide-upload" action="https://httpbin.org/post" :multiple="true" :file-list="fileList" :show-file-list="true"
|
||||||
list-type="picture-card" :on-remove="handleRemove" :on-success="handleSuccess" :before-upload="beforeUpload">
|
list-type="picture-card" :on-remove="handleRemove" :on-success="handleSuccess" :before-upload="beforeUpload">
|
||||||
<el-button size="small" type="primary">点击上传</el-button>
|
<el-button size="small" type="primary">点击上传</el-button>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="upload-container">
|
<div class="upload-container">
|
||||||
<el-upload class="image-uploader" :data="dataObj" drag :multiple="false" :show-file-list="false" action="https://httpbin.org/post"
|
<el-upload class="image-uploader" :data="dataObj" drag :multiple="false" :show-file-list="false" action="https://httpbin.org/post"
|
||||||
:on-success="handleImageScucess">
|
:on-success="handleImageSuccess">
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@@ -43,7 +43,7 @@ export default {
|
|||||||
emitInput(val) {
|
emitInput(val) {
|
||||||
this.$emit('input', val)
|
this.$emit('input', val)
|
||||||
},
|
},
|
||||||
handleImageScucess() {
|
handleImageSuccess() {
|
||||||
this.emitInput(this.tempUrl)
|
this.emitInput(this.tempUrl)
|
||||||
},
|
},
|
||||||
beforeUpload() {
|
beforeUpload() {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="singleImageUpload2 upload-container">
|
<div class="singleImageUpload2 upload-container">
|
||||||
<el-upload class="image-uploader" :data="dataObj" drag :multiple="false" :show-file-list="false" action="https://httpbin.org/post"
|
<el-upload class="image-uploader" :data="dataObj" drag :multiple="false" :show-file-list="false" action="https://httpbin.org/post"
|
||||||
:on-success="handleImageScucess">
|
:on-success="handleImageSuccess">
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">Drag或<em>点击上传</em></div>
|
<div class="el-upload__text">Drag或<em>点击上传</em></div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@@ -42,7 +42,7 @@ export default {
|
|||||||
emitInput(val) {
|
emitInput(val) {
|
||||||
this.$emit('input', val)
|
this.$emit('input', val)
|
||||||
},
|
},
|
||||||
handleImageScucess() {
|
handleImageSuccess() {
|
||||||
this.emitInput(this.tempUrl)
|
this.emitInput(this.tempUrl)
|
||||||
},
|
},
|
||||||
beforeUpload() {
|
beforeUpload() {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="upload-container">
|
<div class="upload-container">
|
||||||
<el-upload class="image-uploader" :data="dataObj" drag :multiple="false" :show-file-list="false" action="https://httpbin.org/post"
|
<el-upload class="image-uploader" :data="dataObj" drag :multiple="false" :show-file-list="false" action="https://httpbin.org/post"
|
||||||
:on-success="handleImageScucess">
|
:on-success="handleImageSuccess">
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
@@ -50,7 +50,7 @@ export default {
|
|||||||
emitInput(val) {
|
emitInput(val) {
|
||||||
this.$emit('input', val)
|
this.$emit('input', val)
|
||||||
},
|
},
|
||||||
handleImageScucess(file) {
|
handleImageSuccess(file) {
|
||||||
this.emitInput(file.files.file)
|
this.emitInput(file.files.file)
|
||||||
},
|
},
|
||||||
beforeUpload() {
|
beforeUpload() {
|
||||||
|
@@ -41,6 +41,11 @@ export default {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
const rawFile = files[0] // only use files[0]
|
const rawFile = files[0] // only use files[0]
|
||||||
|
|
||||||
|
if (!this.isExcel(rawFile)) {
|
||||||
|
this.$message.error('Only supports upload .xlsx, .xls, .csv suffix files')
|
||||||
|
return false
|
||||||
|
}
|
||||||
this.upload(rawFile)
|
this.upload(rawFile)
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@@ -110,6 +115,9 @@ export default {
|
|||||||
headers.push(hdr)
|
headers.push(hdr)
|
||||||
}
|
}
|
||||||
return headers
|
return headers
|
||||||
|
},
|
||||||
|
isExcel(file) {
|
||||||
|
return /\.(xlsx|xls|csv)$/.test(file.name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -29,8 +29,8 @@ export default{
|
|||||||
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
|
ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px'
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px'
|
ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.documentElement.scrollTop || document.body.scrollTop) + 'px'
|
||||||
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px'
|
ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.documentElement.scrollLeft || document.body.scrollLeft) + 'px'
|
||||||
}
|
}
|
||||||
ripple.style.backgroundColor = opts.color
|
ripple.style.backgroundColor = opts.color
|
||||||
ripple.className = 'waves-ripple z-active'
|
ripple.className = 'waves-ripple z-active'
|
||||||
|
@@ -20,8 +20,11 @@ const messages = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const i18n = new VueI18n({
|
const i18n = new VueI18n({
|
||||||
locale: Cookies.get('language') || 'en', // set locale
|
// set locale
|
||||||
messages // set locale messages
|
// options: en or zh
|
||||||
|
locale: Cookies.get('language') || 'en',
|
||||||
|
// set locale messages
|
||||||
|
messages
|
||||||
})
|
})
|
||||||
|
|
||||||
export default i18n
|
export default i18n
|
||||||
|
@@ -202,7 +202,7 @@ export const asyncRouterMap = [
|
|||||||
{
|
{
|
||||||
path: '/nested',
|
path: '/nested',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: '/nested/menu1',
|
redirect: '/nested/menu1/menu1-1',
|
||||||
name: 'nested',
|
name: 'nested',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'nested',
|
title: 'nested',
|
||||||
@@ -214,6 +214,7 @@ export const asyncRouterMap = [
|
|||||||
component: () => import('@/views/nested/menu1/index'), // Parent router-view
|
component: () => import('@/views/nested/menu1/index'), // Parent router-view
|
||||||
name: 'menu1',
|
name: 'menu1',
|
||||||
meta: { title: 'menu1' },
|
meta: { title: 'menu1' },
|
||||||
|
redirect: '/nested/menu1/menu1-1',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: 'menu1-1',
|
path: 'menu1-1',
|
||||||
@@ -225,6 +226,7 @@ export const asyncRouterMap = [
|
|||||||
path: 'menu1-2',
|
path: 'menu1-2',
|
||||||
component: () => import('@/views/nested/menu1/menu1-2'),
|
component: () => import('@/views/nested/menu1/menu1-2'),
|
||||||
name: 'menu1-2',
|
name: 'menu1-2',
|
||||||
|
redirect: '/nested/menu1/menu1-2/menu1-2-1',
|
||||||
meta: { title: 'menu1-2' },
|
meta: { title: 'menu1-2' },
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
@@ -251,6 +253,7 @@ export const asyncRouterMap = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'menu2',
|
path: 'menu2',
|
||||||
|
name: 'menu2',
|
||||||
component: () => import('@/views/nested/menu2/index'),
|
component: () => import('@/views/nested/menu2/index'),
|
||||||
meta: { title: 'menu2' }
|
meta: { title: 'menu2' }
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@ const tagsView = {
|
|||||||
for (const i of state.cachedViews) {
|
for (const i of state.cachedViews) {
|
||||||
if (i === view.name) {
|
if (i === view.name) {
|
||||||
const index = state.cachedViews.indexOf(i)
|
const index = state.cachedViews.indexOf(i)
|
||||||
state.cachedViews = state.cachedViews.slice(index, i + 1)
|
state.cachedViews = state.cachedViews.slice(index, index + 1)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<div class="components-container">
|
<div class="components-container">
|
||||||
<code>Markdown is based on
|
<code>Markdown is based on
|
||||||
<a href="https://github.com/sparksuite/simplemde-markdown-editor" target="_blank">simplemde-markdown-editor</a> ,Simply encapsulated in Vue.
|
<a href="https://github.com/sparksuite/simplemde-markdown-editor" target="_blank">simplemde-markdown-editor</a> ,Simply encapsulated in Vue.
|
||||||
<a target="_blank" href="https://segmentfault.com/a/1190000009762198#articleHeader14">
|
<a target="_blank" href="https://juejin.im/post/593121aa0ce4630057f70d35#heading-15">
|
||||||
相关文章 </a>
|
相关文章 </a>
|
||||||
</code>
|
</code>
|
||||||
<div class="editor-container">
|
<div class="editor-container">
|
||||||
|
@@ -7,19 +7,19 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="margin-bottom:50px;">
|
<div style="margin-bottom:50px;">
|
||||||
<el-col :span="4" class="text-center">
|
<el-col :span="4" class="text-center">
|
||||||
<router-link class="pan-btn blue-btn" to="/components/index">Components</router-link>
|
<router-link class="pan-btn blue-btn" to="/documentation/index">Documentation</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="text-center">
|
<el-col :span="4" class="text-center">
|
||||||
<router-link class="pan-btn light-blue-btn" to="/charts/index">Charts</router-link>
|
<router-link class="pan-btn light-blue-btn" to="/icon/index">Icons</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="text-center">
|
<el-col :span="4" class="text-center">
|
||||||
<router-link class="pan-btn pink-btn" to="/excel/download">Excel</router-link>
|
<router-link class="pan-btn pink-btn" to="/excel/export-excel">Excel</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="text-center">
|
<el-col :span="4" class="text-center">
|
||||||
<router-link class="pan-btn green-btn" to="/example/table/complex-table">Table</router-link>
|
<router-link class="pan-btn green-btn" to="/table/complex-table">Table</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="text-center">
|
<el-col :span="4" class="text-center">
|
||||||
<router-link class="pan-btn tiffany-btn" to="/form/edit-form">Form</router-link>
|
<router-link class="pan-btn tiffany-btn" to="/example/create">Form</router-link>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4" class="text-center">
|
<el-col :span="4" class="text-center">
|
||||||
<router-link class="pan-btn yellow-btn" to="/theme/index">Theme</router-link>
|
<router-link class="pan-btn yellow-btn" to="/theme/index">Theme</router-link>
|
||||||
@@ -130,12 +130,14 @@ export default {
|
|||||||
title: [{ required: true, trigger: 'change', validator: validate }]
|
title: [{ required: true, trigger: 'change', validator: validate }]
|
||||||
},
|
},
|
||||||
articleList: [
|
articleList: [
|
||||||
{ title: '基础篇', href: 'https://segmentfault.com/a/1190000009275424' },
|
{ title: '基础篇', href: 'https://juejin.im/post/59097cd7a22b9d0065fb61d2' },
|
||||||
{ title: '登录权限篇', href: 'https://segmentfault.com/a/1190000009506097' },
|
{ title: '登录权限篇', href: 'https://juejin.im/post/591aa14f570c35006961acac' },
|
||||||
{ title: '实战篇', href: 'https://segmentfault.com/a/1190000009762198' },
|
{ title: '实战篇', href: 'https://juejin.im/post/593121aa0ce4630057f70d35' },
|
||||||
{ title: 'vueAdmin-template 篇', href: 'https://segmentfault.com/a/1190000010043013' },
|
{ title: 'vueAdmin-template 篇', href: 'https://juejin.im/post/595b4d776fb9a06bbe7dba56' },
|
||||||
{ title: '自行封装 component', href: 'https://segmentfault.com/a/1190000009090836' },
|
{ title: '自行封装 component', href: 'https://segmentfault.com/a/1190000009090836' },
|
||||||
{ title: '优雅的使用 icon', href: 'https://segmentfault.com/a/https://segmentfault.com/a/1190000012213278' }
|
{ title: '优雅的使用 icon', href: 'https://juejin.im/post/59bb864b5188257e7a427c09' },
|
||||||
|
{ title: 'webpack4(上)', href: 'https://juejin.im/post/59bb864b5188257e7a427c09' },
|
||||||
|
{ title: 'webpack4(下)', href: 'https://juejin.im/post/5b5d6d6f6fb9a04fea58aabc' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -72,7 +72,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setLocalStorgae() {
|
setLocalStorage() {
|
||||||
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(this.todos))
|
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(this.todos))
|
||||||
},
|
},
|
||||||
addTodo(e) {
|
addTodo(e) {
|
||||||
@@ -82,30 +82,30 @@ export default {
|
|||||||
text,
|
text,
|
||||||
done: false
|
done: false
|
||||||
})
|
})
|
||||||
this.setLocalStorgae()
|
this.setLocalStorage()
|
||||||
}
|
}
|
||||||
e.target.value = ''
|
e.target.value = ''
|
||||||
},
|
},
|
||||||
toggleTodo(val) {
|
toggleTodo(val) {
|
||||||
val.done = !val.done
|
val.done = !val.done
|
||||||
this.setLocalStorgae()
|
this.setLocalStorage()
|
||||||
},
|
},
|
||||||
deleteTodo(todo) {
|
deleteTodo(todo) {
|
||||||
this.todos.splice(this.todos.indexOf(todo), 1)
|
this.todos.splice(this.todos.indexOf(todo), 1)
|
||||||
this.setLocalStorgae()
|
this.setLocalStorage()
|
||||||
},
|
},
|
||||||
editTodo({ todo, value }) {
|
editTodo({ todo, value }) {
|
||||||
todo.text = value
|
todo.text = value
|
||||||
this.setLocalStorgae()
|
this.setLocalStorage()
|
||||||
},
|
},
|
||||||
clearCompleted() {
|
clearCompleted() {
|
||||||
this.todos = this.todos.filter(todo => !todo.done)
|
this.todos = this.todos.filter(todo => !todo.done)
|
||||||
this.setLocalStorgae()
|
this.setLocalStorage()
|
||||||
},
|
},
|
||||||
toggleAll({ done }) {
|
toggleAll({ done }) {
|
||||||
this.todos.forEach(todo => {
|
this.todos.forEach(todo => {
|
||||||
todo.done = done
|
todo.done = done
|
||||||
this.setLocalStorgae()
|
this.setLocalStorage()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -14,12 +14,14 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
articleList: [
|
articleList: [
|
||||||
{ title: '基础篇', href: 'https://segmentfault.com/a/1190000009275424' },
|
{ title: '基础篇', href: 'https://juejin.im/post/59097cd7a22b9d0065fb61d2' },
|
||||||
{ title: '登录权限篇', href: 'https://segmentfault.com/a/1190000009506097' },
|
{ title: '登录权限篇', href: 'https://juejin.im/post/591aa14f570c35006961acac' },
|
||||||
{ title: '实战篇', href: 'https://segmentfault.com/a/1190000009762198' },
|
{ title: '实战篇', href: 'https://juejin.im/post/593121aa0ce4630057f70d35' },
|
||||||
{ title: 'vueAdmin-template 篇', href: 'https://segmentfault.com/a/1190000010043013' },
|
{ title: 'vueAdmin-template 篇', href: 'https://juejin.im/post/595b4d776fb9a06bbe7dba56' },
|
||||||
{ title: '自行封装 component', href: 'https://segmentfault.com/a/1190000009090836' },
|
{ title: '自行封装 component', href: 'https://segmentfault.com/a/1190000009090836' },
|
||||||
{ title: '优雅的使用 icon', href: 'https://segmentfault.com/a/1190000012213278' }
|
{ title: '优雅的使用 icon', href: 'https://juejin.im/post/59bb864b5188257e7a427c09' },
|
||||||
|
{ title: 'webpack4(上)', href: 'https://juejin.im/post/59bb864b5188257e7a427c09' },
|
||||||
|
{ title: 'webpack4(下)', href: 'https://juejin.im/post/5b5d6d6f6fb9a04fea58aabc' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="!item.hidden&&item.children" class="menu-wrapper">
|
<div v-if="!item.hidden&&item.children" class="menu-wrapper">
|
||||||
|
|
||||||
<router-link v-if="hasOneShowingChildren(item.children) && !item.children[0].children&&!item.alwaysShow" :to="resolvePath(item.children[0].path)">
|
<router-link v-if="hasOneShowingChild(item.children) && !onlyOneChild.children&&!item.alwaysShow" :to="resolvePath(onlyOneChild.path)">
|
||||||
<el-menu-item :index="resolvePath(item.children[0].path)" :class="{'submenu-title-noDropdown':!isNest}">
|
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
||||||
<svg-icon v-if="item.children[0].meta&&item.children[0].meta.icon" :icon-class="item.children[0].meta.icon"></svg-icon>
|
<svg-icon v-if="onlyOneChild.meta&&onlyOneChild.meta.icon" :icon-class="onlyOneChild.meta.icon"></svg-icon>
|
||||||
<span v-if="item.children[0].meta&&item.children[0].meta.title" slot="title">{{generateTitle(item.children[0].meta.title)}}</span>
|
<span v-if="onlyOneChild.meta&&onlyOneChild.meta.title" slot="title">{{generateTitle(onlyOneChild.meta.title)}}</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
|
||||||
@@ -36,7 +36,8 @@ import { generateTitle } from '@/utils/i18n'
|
|||||||
export default {
|
export default {
|
||||||
name: 'SidebarItem',
|
name: 'SidebarItem',
|
||||||
props: {
|
props: {
|
||||||
item: { // route配置json
|
// route object
|
||||||
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
@@ -49,10 +50,21 @@ export default {
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
onlyOneChild: null
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hasOneShowingChildren(children) {
|
hasOneShowingChild(children) {
|
||||||
const showingChildren = children.filter(item => {
|
const showingChildren = children.filter(item => {
|
||||||
return !item.hidden
|
if (item.hidden) {
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
// temp set(will be used if only has one showing child )
|
||||||
|
this.onlyOneChild = item
|
||||||
|
return true
|
||||||
|
}
|
||||||
})
|
})
|
||||||
if (showingChildren.length === 1) {
|
if (showingChildren.length === 1) {
|
||||||
return true
|
return true
|
||||||
|
@@ -142,8 +142,21 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss">
|
<style rel="stylesheet/scss" lang="scss">
|
||||||
$bg:#2d3a4b;
|
/* 修复input 背景不协调 和光标变色 */
|
||||||
|
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
|
||||||
|
|
||||||
|
$bg:#283443;
|
||||||
$light_gray:#eee;
|
$light_gray:#eee;
|
||||||
|
$cursor: #fff;
|
||||||
|
|
||||||
|
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
|
||||||
|
.login-container .el-input input{
|
||||||
|
color: $cursor;
|
||||||
|
&::first-line {
|
||||||
|
color: $light_gray;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* reset element-ui css */
|
/* reset element-ui css */
|
||||||
.login-container {
|
.login-container {
|
||||||
@@ -159,9 +172,10 @@ $light_gray:#eee;
|
|||||||
padding: 12px 5px 12px 15px;
|
padding: 12px 5px 12px 15px;
|
||||||
color: $light_gray;
|
color: $light_gray;
|
||||||
height: 47px;
|
height: 47px;
|
||||||
|
caret-color: $cursor;
|
||||||
&:-webkit-autofill {
|
&:-webkit-autofill {
|
||||||
-webkit-box-shadow: 0 0 0px 1000px $bg inset !important;
|
-webkit-box-shadow: 0 0 0px 1000px $bg inset !important;
|
||||||
-webkit-text-fill-color: #fff !important;
|
-webkit-text-fill-color: $cursor !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,7 +230,6 @@ $light_gray:#eee;
|
|||||||
position: relative;
|
position: relative;
|
||||||
.title {
|
.title {
|
||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
font-weight: 400;
|
|
||||||
color: $light_gray;
|
color: $light_gray;
|
||||||
margin: 0px auto 40px auto;
|
margin: 0px auto 40px auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
Reference in New Issue
Block a user