How can vue use mixins or extends, to execute only the beforeMount? of inherited components

problem description

B.vue inherits A.vue, but I only want to execute B.vue "s beforeMount? How to achieve this? I"m a little confused by the official documents .

    import A from "./A.vue";
    export default {
        name: "B",
        extends: A,

        beforeMount() {
        //B beforeMount
        }
    };
Dec.19,2021

I don't know what you mean.

  • How to call template of mixins in vue-cli

    in general vue writing, mixins can be mixed with template var Foo = new Vue({ template: `<div>this is in Foo< div>` }) var Bar = new Vue({ el: "-sharpapp", mixins: [Foo], created () { console.log(Foo) }, tem...

    Sep.07,2021
Menu