VueRouter did not report an error, but the page was rendered blank

my index.js code

import Vue from "vue";
import App from "./App.vue";
import VueRouter from "vue-router";
import routers from "./routers";
Vue.use(VueRouter);
const router = new VueRouter({
    routers
});
let div = document.createElement("div");
div.id = "app";
document.body.appendChild(div);
new Vue({
    router,
    render: h => h(App)
}).$mount("-sharpapp");

my app.vue code

<template>
    <div>
        <router-view></router-view>
    </div>
</template>

<script>
    export default {
        name: "app",
        mounted() {
        window.addEventListener("resize", this.handleResize);
        this.handleResize();
    },
    beforeDestroy() {
        window.removeEventListener("resize", this.handleResize);
    },
    methods: {
        handleResize() {
            var w = document.documentElement.clientWidth;
            document.getElementsByTagName("html")[0].style["font-size"] = Math.min((w / 10).toFixed(1), 540 / 10) + "px";
        }
    }

    }
</script>

roters.js Code

// 
const HomePage = resolve => require(["./pages/index.vue"], resolve);
export default [
    {
        name: "index",
        path: "/index",
        components: HomePage
    }
]

my folder structure

clipboard.png

router.js


dom

clipboard.png

the following is the git warehouse address of my project

https://github.com/wustzhaohui/blog.git


app.vue 's

< / div > doesn't say id= "app", that is, < div id= "app" > < / div >. I don't know if it's document.createElement ('div') that doesn't work well ~

.
new Vue({
    el: '-sharpapp',
    router,
    render: h => h(App)
})

finally I found the problem myself

when index.js new Router should be written

const router = new Router({
    routes: routers    
});

I don't quite understand why the official document says this is OK, but I just can't write it this way.

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b4054b-2c4e8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b4054b-2c4e8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?