In the scope of vue entry files import css and import js files

Why does the introduction of css style files work globally? And the introduction of js files can only work under the current module?
main.js

import a from "./a.js";
//
import "./index.css"

a.js

export default "hello world"

index.css

.title{
    color:red
}

Styles introduced in

main.js are globally available.

import a from'. / a.jsgiving;

to introduce js, you need to use:

Vue.prototype.$hello = a;
/ / so that it can be accessed directly in the subcomponent using this.$hello.
"hello world"

the css introduced in main.js is global. The introduced js file only works in main.js, because main.js is a module in webpack, and a.js is also a module, which cannot be accessed elsewhere, which is the modularization of ES6, so if you want the a.js to be globally available, you need to bind to the global object, such as binding Vue, to expose the a to the global object.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b36cde-41083.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b36cde-41083.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?