Skip to content

二级菜单点击失效 #1557

@xiaolisheng

Description

@xiaolisheng
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.3.16

Environment

windows10,chrome78.0.3904.108,vue2.6.10

Reproduction link

https://github.com/xiaolisheng/ant-design-vue.git

Steps to reproduce

Describe the bug (描述 Bug)

二级菜单点击失效,我搞了一晚上了,求助!!!

A clear and concise description of what the bug is.

我在项目里写了一个商城公共头,并没有使用后台的东西,后台也没有引用我的东西。
这些都不是关键,关键是我按照代码规范写了一个api,

import { getShopUserInfo, getAllCount } from '@/api/shop/common'

这样导入之后代码可以运行,没有报错,也能从后台拿到数据。
但是这行代码却影响到了后台的二级菜单,点击失效。
一级菜单却没有失效,点击可以显示内容。
我百思不得其解,路由从头看了个遍,也没有看出个头头来。

To Reproduce (重现步骤)

Steps to reproduce the behavior:

详细代码如下 略有删减,以便检查

/src/views/Shop/GloabalHeader/GloabalHeader.vue

import { userInfo, allCount } from '@/api/shop/common'
export default {
name: 'GlobalHeader',
methods: {
async getUserInfo () {
await userInfo().then(res => {
const location = res.data.loginIp
const name = res.data.userName
const depart = res.data.deptName
this.location = location
this.name = name
this.depart = depart
})
},
async refreshAllCount () {
await allCount().then(res=>{
const myselectCount = res.data.myselectCount
const myRecomCount = res.data.myRecomCount
const myOrderFormCount = res.data.myOrderFormCount
const mySubscribeCount = res.data.mySubscribeCount
this.myselectCount = myselectCount
this.myRecomCount = myRecomCount
this.myOrderFormCount = myOrderFormCount
this.mySubscribeCount = mySubscribeCount
})
}
}
}

/src/views/Shop/GloabalHeader/index.js

import GlobalHeader from './GlobalHeader'
export default GlobalHeader

/src/api/shop/common.js

import { shopAxios } from '@/utils/request'
const api = {
userInfo:"/shop/index/loginUserInfo",
allCount:'/shop/index/allCount'
}
export function userInfo(){
return shopAxios({
url:api.userInfo,
method:'get'
})
}
export function allCount(){
return shopAxios({
url:api.allCount,
method:'get'
})
}

版本库地址:待...

normal一级菜单

#### normal二级菜单

#### error一级菜单

#### error二级菜单

What is expected?

BUG FIXED!!!

What is actually happening?

I DON'T KNOW.IF I KNOW,I CAN'T BE HERE!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions