end: 新增字典组件<dict></dict>

This commit is contained in:
wangiegie@gmail.com 2017-11-19 22:55:41 +08:00
parent f30cd229cb
commit 9014d8ed2c
4 changed files with 39 additions and 2 deletions

View File

@ -136,7 +136,7 @@ module.exports = {
'wrap-iife': [2, 'any'],
'yield-star-spacing': [2, 'both'],
'yoda': [2, 'never'],
'prefer-const': 2,
'prefer-const': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
'object-curly-spacing': [2, 'always', { objectsInObjects: false }],
'array-bracket-spacing': [2, 'never']

View File

@ -0,0 +1,31 @@
<template>
<div>
<el-select class="filter-item" placeholder="请选择" v-model="dict">
<el-option v-for="item in dicts" :key="item.value" :label="item.label" :value="item.value"> </el-option>
</el-select>
{{dict}}
</div>
</template>
<script>
import fetch from '@/utils/fetch'
export default {
name: 'dict',
props: ['type'],
data() {
return {
dict: undefined,
dicts : [],
}
},
created() {
fetch({
url: '/admin/dict/type/' + this.type,
method: 'get'
}).then(response => {
this.dicts = response.data
})
}
}
</script>

View File

@ -20,13 +20,19 @@
</el-collapse-item>
<el-collapse-item title="页面访问使用" name="6">
<div>wiki:<a href="https://gitee.com/log4j/pig/wikis/页面访问使用" target="_blank">https://gitee.com/log4j/pig/wikis/访使</a></div>
<dict type="lengleng"></dict>
</el-collapse-item>
</el-collapse>
</template>
<script>
import Dict from '@/components/Dict'
export default {
components: {
Dict
},
data() {
return {
activeName: '1'

View File

@ -19,7 +19,7 @@
<a target='_blank' href="https://github.com/PanJiaChen/vue-element-admin/">
<el-dropdown-item>
项目地址
</el-dropdown-item>
</el-dropdown-item>
</a>
<el-dropdown-item divided><span @click="logout" style="display:block;">退出登录</span></el-dropdown-item>
</el-dropdown-menu>