Vue的路由模式处理404

在路由配置的界面进行配置:

{
    
    
  path:'*',
  component: importPage('playVue/error'),
},

定义的错误页面error.vue

<template>
<div>
  <h2>404</h2>
   
</div>
  
</template>

<script>
import BtUi from 'components/basic-ui/bontal-base-ui.umd.min';

export default {
    
    
 
    name:'notFound',
  data(){
    
    
    return{
    
    
    
   
    }
  },
  methods:{
    
    
 
  }
}
</script>

<style  scoped>

</style>

猜你喜欢

转载自blog.csdn.net/houzhicongone/article/details/121682902