fix: 修复菜单组件路径处理逻辑,确保正确生成路径
This commit is contained in:
parent
15fe1f1862
commit
051cc2765e
@ -102,6 +102,9 @@ function handleInitModel() {
|
|||||||
|
|
||||||
if (props.operateType === 'edit' && props.rowData) {
|
if (props.operateType === 'edit' && props.rowData) {
|
||||||
Object.assign(model, props.rowData);
|
Object.assign(model, props.rowData);
|
||||||
|
if (isMenu.value && model.isFrame === '1') {
|
||||||
|
model.component = model.component?.slice(0, -6);
|
||||||
|
}
|
||||||
iconType.value = model.icon?.startsWith('local-icon-') ? '2' : '1';
|
iconType.value = model.icon?.startsWith('local-icon-') ? '2' : '1';
|
||||||
|
|
||||||
if (model.isFrame !== '2') {
|
if (model.isFrame !== '2') {
|
||||||
@ -147,6 +150,8 @@ async function handleSubmit() {
|
|||||||
component = 'Layout';
|
component = 'Layout';
|
||||||
} else if (isFrame === '2') {
|
} else if (isFrame === '2') {
|
||||||
component = 'FrameView';
|
component = 'FrameView';
|
||||||
|
} else if (isMenu.value && model.isFrame === '1') {
|
||||||
|
component = component?.endsWith('/index') ? component : `${component}/index`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// request
|
// request
|
||||||
@ -286,6 +291,7 @@ function onCreate() {
|
|||||||
<NInputGroup>
|
<NInputGroup>
|
||||||
<NInputGroupLabel>views/</NInputGroupLabel>
|
<NInputGroupLabel>views/</NInputGroupLabel>
|
||||||
<NInput v-model:value="model.component" placeholder="请输入组件地址" />
|
<NInput v-model:value="model.component" placeholder="请输入组件地址" />
|
||||||
|
<NInputGroupLabel>/index.vue</NInputGroupLabel>
|
||||||
</NInputGroup>
|
</NInputGroup>
|
||||||
</NFormItemGi>
|
</NFormItemGi>
|
||||||
<NFormItemGi
|
<NFormItemGi
|
||||||
|
Loading…
Reference in New Issue
Block a user