Skip to content

使用 sub-menu 报错 #962

@greenhat616

Description

@greenhat616

The issue which is not created via https://vuecomponent.github.io/issue-helper/ will be closed immediately.


注意:不是用 https://vuecomponent.github.io/issue-helper/http://ant-design-vue.gitee.io/issue-helper/ 创建的 issue 会被立即关闭。

<a-sub-menu>
            <span slot="title"><a-avatar shape="circle" size="large">GU</a-avatar>游客 <a-icon type="down" /></span>
            <a-menu-item key="login">登录</a-menu-item>
            <a-menu-item key="register">注册</a-menu-item>
          </a-sub-menu>

添加这一段代码后报错
环境是 Node 12, nuxt 2.x

image
image

页面代码:

<template>
  <a-layout>
    <a-layout-header>
      <a-row type="flex" align="middle">
        <a-col :span="4">
          <a-row type="flex" align="middle" justify="start" :gutter="24">
            <hitokoto-icon :style="{fontSize: '3em'}" />
            <a-col :offset="1">
              <div class="big-font">Hitokoto</div>
            </a-col>
          </a-row>
        </a-col>
        <a-col :span="7" :offset="9">
          <a-menu mode="horizontal" v-model="current">
            <a-menu-item key="home">
              <a-icon type="home" />首页
            </a-menu-item>
            <a-menu-item key="api">
              <a-icon type="api" />接口说明
            </a-menu-item>
            <a-menu-item key="about">
              <a-icon type="global" />接口说明
            </a-menu-item>
          </a-menu>
        </a-col>
        <a-col :span="4">
          <a-sub-menu>
            <span slot="title"><a-avatar shape="circle" size="large">GU</a-avatar>游客 <a-icon type="down" /></span>
            <a-menu-item key="login">登录</a-menu-item>
            <a-menu-item key="register">注册</a-menu-item>
          </a-sub-menu>
        </a-col>
      </a-row>
    </a-layout-header>
  </a-layout>
</template>
<style>
</style>
<script>
import HitokotoIcon from '~/components/HitokotoIcon.vue'

export default {
  props: ['header'],
  components: {
    HitokotoIcon
  },
  data() {
    return {
      current: ['home']
    }
  }
}
</script>

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