router文件夹里index.js里内容的变化

news/2024/7/10 0:46:34 标签: vue

原来,不行,修改以后,看行不行

const router = createRouter({
  history: createWebHashHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      name: 'home',
      component: () => import(/* webpackChunkName: "home" */ '@/views/Home.vue'),
      meta: {
        index: 1
    }
  }
  ]
})

  export default router;

正确的

import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '../views/Home.vue'
import Data from '../views/Data.vue'
import Acount from '../views/Acount.vue'
import About from '../views/About.vue'

const router = createRouter({
  history: createWebHashHistory(), // hash模式:createWebHashHistory,history模式:createWebHistory
  routes: [
    {
      path: '/',
      component: Home,
  },
    {
      path: '/',
      component: Data,
  },
  {
    path: '/',
    component: Acount,
},
{
  path: '/',
  component: About,
},
  ],
});

  export default router;

http://www.niftyadmin.cn/n/957612.html

相关文章

Python import同级目录报错

版权声明:本文为CSDN博主「ShellCollector」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。 原文链接:https://blog.csdn.net/jacke121/article/details/77260071 ———————————————— …

导航组件的设计

一看就是错的&#xff0c;但也是自己想的啊 <template><span><div>Home</div><div>Data</div><div>Acount</div><div>About</div></span> </template><script> export default {}; </scrip…

用vue写helloworld,写对了

把component里helloworld.vue里和App.vue里的内容都清除掉了 再在App.vue里写上内容。 component&#xff0c;不涉及到组件&#xff0c;暂时不涉及&#xff0c;里头不用填 填App.vue里的 <template> Hello World ! </template><script> export default { } …

解决Windows 资源保护找到了损坏文件但无法修复问题

今天Windows 8.1系统的电脑突然卡住并且自动重启&#xff0c;通过事件查看器得到的资料有限&#xff0c;初步怀疑是系统文件受损导致&#xff0c;于是通过经典的sfc /scannow验证系统并修复受损文件&#xff0c;但是得到以下提示&#xff1a; 开始系统扫描。此过程将需要一些时…

python解析xml文件(解析、更新、写入)

Overview 这篇博客内容将包括对XML文件的解析、追加新元素后写入到XML&#xff0c;以及更新原XML文件中某结点的值。使用的是python的xml.dom.minidom包&#xff0c;详情可见其官方文档&#xff1a;xml.dom.minidom官方文档。全文都将围绕以下的customer.xml进行操作&#xff1…

Python 列表中的元素互换位置

1. 两个元素互换位置 a [1,2] print(a) a[0], a[1] a[1], a[0] print(a)列表是可变对象&#xff0c;变动里面的元素本身的id不会发生变化&#xff0c;以下代码说明了问题。 oneSimpleList [1,2] a oneSimpleList print(id(a), id(oneSimpleList)) print(a, oneSimpleList…

这个到底应该怎么摆呢,怎么摆都不对,写在index.html里不行,写在App.vue里也不行

App.vue里不行 <template><div id"counter">counter: {{ counter }}</div> </template><script>export default {const Counter {data() {return {counter:0}}}}Vue.createrApp(Counter).mount(#counter)</script>index.html里…

python中numpy.array的用法(list转换,读取,保存)

python中List类型与numpy.array类型的互相转换 import numpy as np List转numpy.array: temp np.array(list) numpy.array转List: arr temp.tolist() Python中数据的保存和读取 保存 numpy.save() 和 numpy.load()numpy.save(arg_1,arg_2) 需要两个参数&#xff0…