Why can't the methods in app.vue trigger the vue project built by vue-cli?

app.vue Code

<template>
    <div id="app">
        <ipsa-menu style="position:relative;z-index: 999;"
                   userPhoto="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1536247527540&di=69b5d66745ae8a452f0f960083cd8384&imgtype=0&src=http%3A%2F%2Fpic.fxxz.com%2Fup%2F2017-9%2F2017921188403069.jpg"></ipsa-menu>
        <router-view class="bodyAuto"></router-view>
    </div>
</template>
<script>
    export default {
        name: "app",
        methods:{
            showErrMag(mag){
                this.$Modal.error({
                    title: "",
                    content: "

"+ mag +"

" }); } }, created(){ console.log(this.$route.path) } } </script> <style lang="less"> -sharpapp { font-family:"PingFang SC","Microsoft YaHei","SimSun","Arial", sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; /*text-align: center;*/ color: -sharp2c3e50; } /*body{*/ /*margin: 0;*/ /*}*/ a { color: -sharp00B7FF; } </style> <script> // @ is an alias to /src import ipsaMenu from "@/components/ipsamenu/ipsaMenu.vue"; export default { name: "app", components: { ipsaMenu } }; </script>

after running, the methods in created are not executed, resulting in screenshots

clipboard.png

I haven"t found out why for a long time, and I haven"t found anything related to it on the Internet. I hope I can help you with the same problem. Thank you

.
Sep.06,2021

has this component (page / route) been called?
this is the simplest
http://localhost:3000/-sharp/app 's route name
app's route name is changed to your configured route name to see if the trigger triggers
.

QQ has been solved, according to what the landlord said, it is not perfect. There are several

plans.

there is no problem with this. You can see if the page is wrong, add the following code to main.js , and see


main.js:

import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import iView from 'iview';
import 'iview/dist/styles/iview.css';
import '@/my-theme/index.less';
import '@/assets/css/iconfont.css';
import '@/assets/css/common.less';

Vue.config.productionTip = false;
Vue.use(iView);

new Vue({
    router,
    created() {
        console.log(this.$route.path)
    },
    store,
    render: h => h(App)
}).$mount("-sharpapp");

at the same time, thank you very much for your kind help

Menu