mune change

This commit is contained in:
zhangtao 2022-05-24 09:20:29 +08:00
parent d67c03dd84
commit b225781cd2
4 changed files with 16 additions and 25 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<n-modal v-model:show="getModalOptions" preset="dialog"> <n-modal v-bind="getModalOptions" preset="dialog">
<n-card> <n-card>
<slot name="Context" /> <slot name="Context" />
</n-card> </n-card>
@ -8,28 +8,13 @@
<script> <script>
import { defineComponent, computed } from 'vue' import { defineComponent, computed, unref } from 'vue'
export default defineComponent({ export default defineComponent({
name: 'ModalModules', name: 'ModalModules',
props: { props: {
/* 弹窗可见 */ options: {
visible: { type: Object,
type: Boolean, default: () => {}
default: false
},
/* 弹窗标题 */
title: {
type: String,
default: ''
},
/* 确定按钮的loading */
confirmLoading: {
type: Boolean,
default: false
},
maskClosable: {
type: Boolean,
default: true
} }
}, },
emits: { emits: {
@ -40,8 +25,9 @@ export default defineComponent({
}, },
setup(props, { emit }) { setup(props, { emit }) {
const getModalOptions = computed(() => { const getModalOptions = computed(() => {
return props.visible return unref(props.options)
}) })
console.log(getModalOptions)
const handleClick = function() { const handleClick = function() {
emit('click') emit('click')
} }

View File

@ -132,7 +132,7 @@ cacheRoutes.forEach((cacheRoute) => {
const findRoute = routes.find((route) => route.path === cacheRoute.path) const findRoute = routes.find((route) => route.path === cacheRoute.path)
if (route) { if (route) {
cacheRoute.meta = findRoute.meta || cacheRoute.meta 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 } * @return { Object }
*/ */
function getSimpleRoute(route) { function getSimpleRoute(route) {
const { fullPath, hash, meta, title, params, path, query } = route const { fullPath, hash, meta, name, params, path, query } = route
return { fullPath, hash, meta, title, params, path, query } return { fullPath, hash, meta, name, params, path, query }
} }
/** /**

View File

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

View File

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