view-ui,四级动态菜单目录,点击跳转

博客提及有配置动态目录并实现点击跳转的需求,采用了view - ui,四级菜单数据由后端返回且为嵌套数据,给出的代码可作为参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.有需求要求配置一个动态目录,并且点击哪里跳转到哪里

    我采用了view-ui,四级菜单是后端返回的嵌套数据,此代码仅作为参考

<Menu active-name="2" :accordion="true">
                <Submenu name="2">
                    <template slot="title">
                        <b>目录</b><Icon  style="position:absolute;top:35%;right:30px;" type="ios-arrow-down" />
                    </template>
                    <Submenu :class="item.id"  :name="'2-' + index" v-for="(item,index) in contwz" :key="index" >
                        <template slot="title" > <a  @click="changeHash('#n' + item.id,item.id)" ><p  v-html="item.name" style="font-size:14px !important;">{{item.name}}</p></a><Icon v-if="item.children.length>0" style="position:absolute;top:30%;right:30px;" type="ios-arrow-down" /></template>
                        <span v-if="item.children">
                        <Submenu :class="itemtwo.id" :name="'2-' + index + '-' + indextwo" v-for="(itemtwo,indextwo) in item.children" :key="indextwo">
                            <template slot="title" > <a @click="changeHash('#n' + itemtwo.id,itemtwo.id)"><p v-html="itemtwo.name" style="font-size:14px !important;">{{itemtwo.name}}</p></a><Icon v-if="itemtwo.children.length>0" style="position:absolute;top:30%;right:30px;" type="ios-arrow-down" /></template>
                            <span v-if="itemtwo.children">
                                <Submenu :name="2- + '' + index + '' + indextwo + '' + indexthird" v-for="(itemthird,indexthird) in itemtwo.children" :key="indexthird">
                                    <template slot="title" > <a @click="changeHash( itemthird.id)"><p v-html="itemthird.name" style="font-size:14px;">{{itemthird.name}}</p></a><Icon v-if="itemthird.children.length>0" style="position:absolute;top:30%;right:30px;" type="ios-arrow-down" /></template>
                                    <span v-if="itemthird.children">
                                         <Submenu :name="2- + '' + index + '' + indextwo + '' + indexthird + '' + indexfour" v-for="(itemfour,indexfour) in itemthird.children" :key="indexfour">
                                            <template slot="title" > <a @click="changeHash('#n' + itemfour.id)"><p v-html="itemfour.name" style="font-size:14px;">{{itemfour.name}}</p></a><Icon v-if="itemfour.children.length>0" style="position:absolute;top:30%;right:30px;" type="ios-arrow-down" /></template>
                                         </Submenu>
                                    </span>
                                </Submenu>
                            </span>
                        </Submenu>
                        </span>
                    </Submenu>
                </Submenu>
            </Menu>

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值