What is the problem with the routing configuration of the vue-cli building project?

the project structure is shown in figure
clipboard.png

:

clipboard.png

HellowWorld.vue

<template>
  <div class="hello">
    124
    <router-view></router-view>
  </div>
</template>

global.vue

<template>
  <div class="page">
      <h1>vueapi</h1>
  </div>
</template>

but the page is only 124 with no H1 tag

Mar.18,2021

redirect is written as'/ HelloWorld'. Try


redirect followed by the path name, not the component name.
change to'/ HelloWorld' try


your child routing page's url is / HellowWorld/api/global, and the page redirectd is / HellowWorld, of course you can't see it.

Menu