修复菜单active_menu参数刷新页面后失效问题

This commit is contained in:
孟帅
2023-05-11 22:33:34 +08:00
parent f7c8092aee
commit b20bc33790
5 changed files with 32 additions and 26 deletions

View File

@@ -150,6 +150,10 @@
onMounted(() => {
updateMenu();
const matched = currentRoute.matched;
state.openKeys = matched.map((item) => item.name);
const activeMenu: string = (currentRoute.meta?.activeMenu as string) || '';
selectedKeys.value = activeMenu ? (activeMenu as string) : (currentRoute.name as string);
});
return {

View File

@@ -105,7 +105,7 @@
width: 200,
},
{
title: '状态',
title: '状态',
key: 'status',
render(row) {
return h(
@@ -180,9 +180,9 @@
{
field: 'status',
component: 'NSelect',
label: '状态',
label: '状态',
componentProps: {
placeholder: '请选择状态',
placeholder: '请选择状态',
options: [
{
label: '未使用',
@@ -247,7 +247,7 @@
message.success('操作成功');
reloadTable();
})
.catch((e: Error) => {
.catch((_e: Error) => {
// message.error(e.message ?? '操作失败');
});
},
@@ -289,11 +289,6 @@
actionRef.value.reload();
}
function handleEdit(record: Recordable) {
console.log('点击了编辑', record);
router.push({ name: 'sms_view', params: { id: record.id } });
}
function handleSubmit(values: Recordable) {
console.log(values);
reloadTable();