最后成功了,router,罪魁祸首是没有views/home这段

news/2024/7/9 23:55:35 标签: vue

找半天

import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '@/views/Home'

const router = createRouter({
    history: createWebHashHistory(),
    routes: [
        {
            path: '/',
            component: Home
        },
        {
            path: '/Home',
            component: Home 
        }
    ]
})

export default router;

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

相关文章

在项目里实现单文件的功能,只需要改一下HelloWorld.vue的内容即可

HelloWorld.vue <template><div id"app"><div v-bind:style"styleObject">《Java无难事》</div></div> </template><script> export default {name: HelloWorld,data() {return {styleObject: {color: red,fon…

三级目录怎么做html,三级目录.html

&#xfeff;三级目录$axure.utils.getTransparentGifPath function() { return resources/images/transparent.gif; };$axure.utils.getOtherPath function() { return resources/Other.html; };$axure.utils.getReloadPath function() { return resources/reload.html; };…

什么叫内联样式,有什么功能?

style是它的标志吗&#xff1f; 《java无难事》这个就是定义&#xff0c;绑定了一个样式&#xff0c;对象中&#xff0c;数据属性中定义了这个文字是红色&#xff0c;以及字的大小。 与别的非内联样式有什么区别&#xff1f; <template><div id"app">&…

html5随鼠标移动动画,使用JS实现气泡跟随鼠标移动的动画效果

气泡跟随鼠标移动&#xff0c;并在每次点击时产生不同的变化效果如下简单的气泡效果body{background-color:#000000;margin:0px;overflow:hidden}var canvas document.createElement(canvas),context canvas.getContext(2d),windowW window.screen.width ,windowH window.s…

html+table+row+col,html – css位置:粘不使用display:table-row-group

我有一个包含一些数据的表,我希望标题是粘性的.该表如下所示&#xff1a;Col ACol Bxx最小的CSS.table {display: table;}.row {display: table-row-group; /* remove this, it works, but is ugly */}.header {position: -webkit-sticky;position: sticky;top: 0;}.cell {disp…

内联样式的数组语法,对页面边框和背景两个的约定

<template><div id"app"><div v-bind:style"[baseStyles, moreStyles]">《Java无难事》</div></div> </template><script> export default {name: HelloWorld,data() {return {baseStyles: {border: solid 2px …

v-for后面的key的用法,举两个例子

官网的说法&#xff1a;key https://cn.vuejs.org/v2/api/#key 一般的用法习惯&#xff1a; <ul><li v-for"item in items" :key"item.id">...</li> </ul><tr v-for"(book, index) in books":key"book.id&quo…

绑定html class,给v-bind:class传递一个对象,以动态地切换class

<template><div id"app"><div v-bind:class"{ active: isActive }">Java无难事</div></div> </template><script> export default {name: HelloWorld,data() {return {isActive: true}} } </script><s…