want a function that inherits the parent class, calls public methods, and gets common parameters
first navigate to a specific component Page.vue based on a type
<template>
<div>
<component :is="page"></component>
</div>
</template>
<script>
import AddPage from "./AddPage"
export default {
name: "Page",
props: [],
data () {
return {
page: "AddPage"
}
},
components: {
AddPage
},
mounted () {
}
}
</script>
then there is a base class Base.vue
<template>
<div>
base
</div>
</template>
<script>
export default {
name: "Base",
props: [],
data () {
return {
}
},
methods: {
save () {
console.log("b save")
}
},
mounted () {
console.log("base mounted")
}
}
</script>
then my implementation class AddPage.vue
<template>
<div>
add
</div>
</template>
<script>
import Base from "Base"
export default {
name: "AddPage",
extends: Base,
props: [],
data () {
return {
}
},
mounted () {
console.log("add mounted")
}
}
</script>
is there a problem with using extends inheritance in this way? The error in my execution is as follows
found in
-> < Page > at src/page/Page.vue