MenuItem 重定向

HTML

<template>
  <Header :style="{padding: 0}">
    <Menu mode="horizontal" theme="dark" :style="{'background-color': 'transparent'}">
      <Row type="flex" justify="center">
        <Col span="7" class-name="p-5">
          <router-link :to="{name: 'Home'}">
            <img src="@/assets/images/cnode_logo.png" alt="cnode_logo" class="inline-pic" />
          </router-link>
        </Col>
        <Col span="9" offset="6">
          <div class="ks-clear">
            <MenuItem :name="index" v-for="(item, index) in topNav" :key="item.path" :to="{name: item.name}">{{item.title}}</MenuItem>
          </div>
        </Col>
      </Row>
    </Menu>
  </Header>
</template>

Vue

let topNav = [
  {
    path: '/',
    name: 'Home',
    title: '首页',
    redirect: '/main/all'
  },
  {
    path: '/newcomer',
    name: 'Newcomer',
    title: '新手入门'
  },
  {
    path: '/api',
    name: 'Api',
    title: 'API'
  },
  {
    path: '/about',
    name: 'About',
    title: '关于'
  },
  {
    path: '/signup',
    name: 'Signup',
    title: '注册'
  },
  {
    path: '/signin',
    name: 'Signin',
    title: '登录'
  }
];

export default topNav;