需求:点击A页面的li跳转并展开B页面菜单的二级submenu,点击ul下的“更多”跳转到对应ul的分类标题的B页面一级菜单下

一、A页面

	<ul style="list-style-type: cjk-ideographic; overflow-y: hidden;">
		{volist name="vo.list" id="vo2"}
           <li @click="jumpUrl('organ{$vo.organ_id}','{$vo2.id}')">
              <span>{$vo2.name}</span>
           </li>
		{/volist}
	</ul>
	<p><a href="#" style="text-decoration:none;" @click="jumpUrlmore('{$vo.organ_id}','')" id="more">更多</a></p>

二、A页面methods

 	//id展示开单位所有报表制度
	jumpUrlmore(id){
       window.location.href=api.levelsearch.searchmenu+"/ids/"+"organ"+id;
    },
 	// 展开报表制度下所有的模板
    jumpUrl(organ_id,rule_id){
       localStorage.setItem("organ_id",organ_id);
		window.location.href=api.levelsearch.searchmenu+"/ids/"+"rule"+organ_id;
     },

三、B页面

	<el-menu :default-openeds="id"  class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
		{volist name="rulelist" id="vo"}
			<el-submenu index="organ{$vo.organ_id}">
				<template slot="title">
					<span>{$vo.organ_name}</span>
				</template>
				{volist name="vo.list" id="vo2"}
					<el-submenu index="{$vo2.id}">
						<template slot="title">
							<span>{$vo2.name}</span>
						</template>
						<el-menu-item-group>
							{volist name="vo2.form_list" id="vo3"}
								<el-menu-item index="{$vo3.id}" @click="gethtml({$vo3.id})">{$vo3.name}{$vo3.id}</el-menu-item>
							{/volist}
					</el-menu-item-group>
					</el-submenu>
				{/volist}
			</el-submenu>
		 {/volist}
	 </el-menu>

四、B页面data

id:[organ_id.toString(),'{$table_id}'],

重点=》id:[organ_id.toString(),’{$table_id}’]。:default-openeds=“Array”,展开子级submenu需要获取子submenu的父级index

Logo

前往低代码交流专区

更多推荐