Vue routing subcomponent mounted reported an error?

the code is as follows:

const homepage = {template: "-sharphome-page",mounted:function () {
   vm.homeInit()
  }};
        
const router = new VueRouter({
        routes: [
            {path: "/", component: homepage},
            {path: "/process", component: process},
            {path: "/feature", component: feature}
        ]
    });
const vm = new Vue({
        el: "-sharpapp",
        data:{
            name : 1
        },
        router,
        methods: {
            homeInit: function () {
                console.log("1");
            }
        }
        });

When

switches to "/", the method can execute (see figure)
clipboard.png

but keep reporting wrong: vm is not defined,. Excuse me, what is it?

Oct.20,2021

is not defined. Change the order of
const vm.
const homepage

vm on top

Menu