Vue.js 使用http Vue加载程序时,在装入依赖项之前装入Vue组件
我有一个父组件(Vue.js 使用http Vue加载程序时,在装入依赖项之前装入Vue组件,vue.js,vue-component,vue-loader,Vue.js,Vue Component,Vue Loader,我有一个父组件(CyaCandidateItem),它有一个槽来呈现子组件(CyaCandidateItemActions)。包装器组件(cyanformativecandidateItem)将子组件注入父组件的插槽中 new Vue({ el: '#main', components: { 'CyaInformativeCandidateItem': Vue.component('CyaInformativeCandidateItem', {
CyaCandidateItem
),它有一个槽来呈现子组件(CyaCandidateItemActions
)。包装器组件(cyanformativecandidateItem
)将子组件注入父组件的插槽中
new Vue({
el: '#main',
components: {
'CyaInformativeCandidateItem': Vue.component('CyaInformativeCandidateItem', {
name: 'CyaInformativeCandidateItem',
template: `
<cya-candidate-item ref="self">
<cya-candidate-item-actions slot="action-buttons" ref="actions"></cya-candidate-item-actions>
</cya-candidate-item>`,
components: {
'CyaCandidateItem': Vue.component('CyaCandidateItem',{ // EMBEDDED component
name: 'CyaCandidateItem',
template: `
<div>
<slot name="action-buttons"></slot>
</div>
`
}),
'CyaCandidateItemActions': Vue.component('CyaCandidateItemActions',{
name: 'CyaCandidateItemActions',
template : `
<div class="actions">
<button>Hallo</button>
</div>`,
data: function(){
return {};
}
})
},
mounted: function(){
console.log('mounted', this.$refs.actions, this.$refs.self, this.$refs);
}
})
},
mounted: function(){}
});
似乎在装载依赖项之前已装载依赖项组件
使用http vue加载程序时,这是预期的行为吗
'CyaCandidateItem': httpVueLoader('/assets/CyaCandidateItem.vue')