How does Vue introduce a js file written by itself?

for example, the code is as follows:

components.js

import Vue from "vue"
import { Grid, GridItem } from "vux"

Vue.component("grid", Grid)
Vue.component("grid-item", GridItem)
...
...
...

how to main.js the above js file in the vue-cli project. There is no export statement in the above js file.

Mar.05,2021

import { AlertPlugin, ConfirmPlugin } from 'vux'
    
Vue.use(ConfirmPlugin)
Vue.use(ToastPlugin)

.


Vue.component is used to register global components,
so you can directly import this module

import '/path/to/components.js'

usage instructions:

Import a module only for side effects
import a module only for side effects of the module, without importing anything in the module. This runs the global code in the module, but does not actually import any values.
For more information, please see MDN

.
Menu