• el-menu 菜单展示


    <template>
    	<div class="tab-container">
    		<el-menu class="el-menu-vertical-demo" background-color="#424242" text-color="#f8f8f8" active-text-color="#f8f8f8">
    			<div v-for="(taskItem,taskIndex) in taskStepData" :key="taskIndex">
    				<el-submenu :index="String(taskItem.id)" v-if="taskItem.children&&taskItem.children.length>0">
    					<template slot="title">
    						<i>*</i>
    						<span>{{taskItem.note}}</span>
    					</template>
    					<el-menu-item :index="String(taskItem.id)" v-for="(childVal,childIndex) in taskItem.children" :key="'taskItem.id'+childIndex">
    						<template slot="title">
    							<span>{{childVal.note}}</span>
    						</template>
    					</el-menu-item>
    				</el-submenu>
    				<el-menu-item :index="String(taskItem.id)" v-else>
    					<template slot="title">
    						<i>*</i>
    						<span>{{taskItem.note}}</span>
    					</template>
    				</el-menu-item>
    			</div>
    		</el-menu>
    	</div>
    </template>
    
    <script>
    	export default {
    		name: 'tab',
    		data() {
    			return {
    				taskStepData: [
    					{
    						"note": "通用",
    						"id": 1,
    						"children": [{
    								"note": "开始",
    								"id": 5
    							},
    							{
    								"note": "结束",
    								"id": 6
    							},
    							{
    								"note": "添加序列",
    								"id": 7
    							}
    						]
    					},
    					{
    						"note": "输入",
    						"id": 2,
    						"children": [{
    							"note": "Json输入",
    							"id": 8
    						}]
    					},
    					{
    						"note": "输出",
    						"id": 3,
    						"children": []
    					}
    				]
    			}
    		},
    		methods: {
    
    		}
    	}
    </script>
    
    <style scoped>
    	.tab-container {
    		margin: 30px;
    	}
    </style>
    
  • 相关阅读:
    webpack 入门(1)入口(entry)出口(output
    npm 常用使用命令
    typora快捷键
    一些思考
    SED LEARN NOTE
    常用网站工具整理
    DFTC
    Notion使用技巧
    BASH LEARN NOTE
    STBC公式
  • 原文地址:https://www.cnblogs.com/zhaozhenzhen/p/11419050.html
Copyright © 2020-2023  润新知