Browse Source

mune change

master
zhangtao 2 years ago
parent
commit
b225781cd2
4 changed files with 16 additions and 25 deletions
  1. +7
    -21
      src/components/Modal/index.vue
  2. +3
    -3
      src/layout/components/Tags/index.vue
  3. +5
    -0
      src/store/modules/permission.js
  4. +1
    -1
      src/views/system/menu/components/RoleModal.vue

+ 7
- 21
src/components/Modal/index.vue View File

@@ -1,5 +1,5 @@
<template>
<n-modal v-model:show="getModalOptions" preset="dialog">
<n-modal v-bind="getModalOptions" preset="dialog">
<n-card>
<slot name="Context" />
</n-card>
@@ -8,28 +8,13 @@

<script>

import { defineComponent, computed } from 'vue'
import { defineComponent, computed, unref } from 'vue'
export default defineComponent({
name: 'ModalModules',
props: {
/* 弹窗可见 */
visible: {
type: Boolean,
default: false
},
/* 弹窗标题 */
title: {
type: String,
default: ''
},
/* 确定按钮的loading */
confirmLoading: {
type: Boolean,
default: false
},
maskClosable: {
type: Boolean,
default: true
options: {
type: Object,
default: () => {}
}
},
emits: {
@@ -40,8 +25,9 @@ export default defineComponent({
},
setup(props, { emit }) {
const getModalOptions = computed(() => {
return props.visible
return unref(props.options)
})
console.log(getModalOptions)
const handleClick = function() {
emit('click')
}

+ 3
- 3
src/layout/components/Tags/index.vue View File

@@ -132,7 +132,7 @@ cacheRoutes.forEach((cacheRoute) => {
const findRoute = routes.find((route) => route.path === cacheRoute.path)
if (route) {
cacheRoute.meta = findRoute.meta || cacheRoute.meta
cacheRoute.title = (findRoute.title || cacheRoute.title)
cacheRoute.name = (findRoute.name || cacheRoute.name)
}
})

@@ -163,8 +163,8 @@ watch(
* @return { Object }
*/
function getSimpleRoute(route) {
const { fullPath, hash, meta, title, params, path, query } = route
return { fullPath, hash, meta, title, params, path, query }
const { fullPath, hash, meta, name, params, path, query } = route
return { fullPath, hash, meta, name, params, path, query }
}

/**

+ 5
- 0
src/store/modules/permission.js View File

@@ -79,6 +79,11 @@ function dataArrayToRoutes(routes) {
const component = `../${sub_view}.vue`
tmp.component = modules[component]
}
tmp.name = tmp.title
tmp.meta = {
...tmp.meta,
title: tmp.title
}
res.push(tmp)
})
return res

+ 1
- 1
src/views/system/menu/components/RoleModal.vue View File

@@ -7,7 +7,7 @@
</template>

<script>
import { defineComponent, reactive, computed } from 'vue'
import { defineComponent, computed } from 'vue'
import Modal from '@/components/Modal/index.vue'
export default defineComponent({
name: 'MenuModal',

Loading…
Cancel
Save