Why write an indexj.s when vue references a build?

as shown in the figure, the purpose of this index.js is to export the component. But wouldn"t it be possible to use this component through import login-form.vue elsewhere without writing this index.js?

Apr.29,2022

this is written for your convenience in import.
if you don't write like this, you have to write this when you import:


index.jsvue

import _SysUser from './BCSysUser.vue'
import _SysRole from './BCSysRole.vue'

const SysAdminComponent = {
    install: function(Vue) {
        Vue.component('bc-sys-user', _SysUser)
        Vue.component('bc-sys-role', _SysRole)
    }
}

export default SysAdminComponent
Menu