@@ -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') | |||
} |
@@ -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 } | |||
} | |||
/** |
@@ -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 |
@@ -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', |