【发布时间】:2020-09-28 13:19:05
【问题描述】:
I am trying to call `beforemount()` method from "A" file , this file is imported in another file which is called on homepage that is "B".
I am not sure what i am missing here.
问题是“A”文件中的beforemount() 方法没有调用,而是文件
“B”具有调用前端的相同方法,似乎组件没有在父文件中被调用(我在父文件中安装之前也有(文件B也是)
这是我在两个文件中添加的潜在代码,请查看并告诉我
File B
<script>
import A from 'one/components/theme/A.vue'
export default {
data () {
return {
A
},
components: {
A
}
}
</script>
FILE A
<template>
<div class="A"/>
</template>
<script>
export default {
name: 'A',
beforeMount () {
console.log('segment beforeMount')
},
}
【问题讨论】:
-
至少您缺少问题中的代码;)
-
请再次检查问题,更新问题
标签: vue.js vuejs2 vue-component vuex