用commonjs的规范导出导入:
导出:
const name = 'a'
const height:18
module exports = {
name,
height
}
导入:
const {name,height) require('./xxx.js')
ES6的导入导出:
导出:
export const name = 'a'
导入:
import {name} from ('./xxx.js')
用commonjs的规范导出导入:
导出:
const name = 'a'
const height:18
module exports = {
name,
height
}
导入:
const {name,height) require('./xxx.js')
ES6的导入导出:
导出:
export const name = 'a'
导入:
import {name} from ('./xxx.js')