//加载模块
import 模块名称 from '模块标识符' //如import Vue from 'vue'
import '表示路径' //如import './css/index.css'
//向外暴露的成员
export defaul {} //可以使用任意的变量来接收,只允许向外暴露1次
export //使用{}来接受,允许向外暴露多次
在test.js文件中
var info = {
name: 'zs',
age: 20
}
export default info
export var title = '小星星'
export var content = '哈哈哈'
在main.js文件中
import m222, { title as title123, content } from './test.js'
console.log(m222)
console.log(title123 + ' --- ' + content)