Coder Social home page Coder Social logo

Comments (4)

qppq54s avatar qppq54s commented on June 15, 2024

id改成 ‘1’ 试试

from ant-design-vue.

linzehai0801 avatar linzehai0801 commented on June 15, 2024

image




aaa



{{ menu.id }}










{{ menu.title }}








<a class="ant-dropdown-link" @click.prevent>
Hover me


<template #overlay>


1st menu item


2nd menu item


3rd menu item




    <div style="float: right;padding-right: 20px">
      <a-avatar :size="32">
        <template #icon>
          <UserOutlined/>
        </template>
      </a-avatar>
    </div>
  </a-layout-header>
  <a-layout-content style="margin: 0 16px">
    <!--        <a-breadcrumb style="margin: 16px 0">-->
    <!--          <a-breadcrumb-item>主页</a-breadcrumb-item>-->
    <!--          <a-breadcrumb-item>Bill</a-breadcrumb-item>-->
    <!--          <a-breadcrumb-item>aaa</a-breadcrumb-item>-->
    <!--        </a-breadcrumb>-->
    <a-breadcrumb style="margin: 16px 0">
      <a-breadcrumb-item>主页</a-breadcrumb-item>
      <template v-for="item in menu_list" :key="item.id">
        <a-breadcrumb-item v-if="item.id === selectedKeys[0]">{{ item.title }}</a-breadcrumb-item>
      </template>
    </a-breadcrumb>

    <div :style="{ padding: '24px', background: '#fff', minHeight: '360px' }">
      <router-view></router-view>
    </div>
  </a-layout-content>
  <a-layout-footer style="text-align: center">
    Ant Design ©2024 Created by Ant UED
  </a-layout-footer>
</a-layout>
<script setup>

import {defineComponent, ref} from 'vue';
import {
PieChartOutlined,
DesktopOutlined,
FieldTimeOutlined,
UserOutlined,
DownOutlined
} from '@ant-design/icons-vue'

const collapsed = ref(false);
const selectedKeys = ref(['1']);
const menu_list = ref([
{
id: 1, icon: 'PieChartOutlined', title: '展示中心', tube: '', 'menu_url': '/uric/show_center', children: []
},
{
id: 2, icon: 'DesktopOutlined', title: '资产管理', 'menu_url': '/uric/host', children: []
},
{
"id": 3, icon: 'bold', title: '批量任务', tube: '', menu_url: '/uric/workbench', children: [
{id: 10, icon: 'mail', title: '执行任务', 'menu_url': '/uric/multi_exec'},
{id: 11, icon: 'mail', title: '命令管理', 'menu_url': '/uric/template_manage'},
]
},
{
id: 4, icon: 'highlight', title: '代码发布', tube: '', menu_url: '/uric/workbench', children: [
{id: 12, title: '应用管理', menu_url: '/uric/release'},
{id: 13, title: '发布申请', menu_url: '/uric/release'}
]
},
{id: 5, icon: 'FieldTimeOutlined', title: '定时计划', tube: '', menu_url: '/uric/workbench', children: []},
{
id: 6, icon: 'mail', title: '配置管理', tube: '', menu_url: '/uric/workbench', children: [
{id: 14, title: '环境管理', 'menu_url': '/uric/environment'},
{id: 15, title: '服务配置', 'menu_url': '/uric/workbench'},
{id: 16, title: '应用配置', 'menu_url': '/uric/workbench'}
]
},
])

</script> <style scoped> #components-layout-demo-side .logo { height: 32px; margin: 16px; background: rgba(255, 255, 255, 0.3); }

.site-layout .site-layout-background {
background: #fff;
}

[data-theme='dark'] .site-layout .site-layout-background {
background: #141414;
}
</style>这是我的脚本麻烦帮忙看看

from ant-design-vue.

qppq54s avatar qppq54s commented on June 15, 2024

@linzehai0801 我的意思是,你的id是数字,但是selectKeys里的是字符串,这两个要保持统一,把你menu_list里的id:1改成id: '1'这样

from ant-design-vue.

github-actions avatar github-actions commented on June 15, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

from ant-design-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.