赞
踩
<template> <view> <button @click="showSubMenu">点击显示二级菜单</button> <view v-if="showSub"> <button v-for="(item, index) in subMenu" :key="index">{{ item }}</button> </view> </view> </template> <script> export default { data() { return { showSub: false, // 控制二级菜单的显示与隐藏 subMenu: ["按钮1", "按钮2", "按钮3", "按钮4"] // 二级菜单的按钮数据 }; }, methods: { showSubMenu() { this.showSub = !this.showSub; // 点击按钮后显示二级菜单 } } } </script> <style lang="scss"> </style>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。