module.exports和export,对应require

module.exports = {
    userName:'zhangdan',
    say:function () {
        return 'hello';
    }
}

exports.userName = "tom";
exports.say = function () {
    return "hello";
}

这两种方式一样,对应的是require

export和export default对应的import

猜你喜欢

转载自blog.csdn.net/TCF_JingFeng/article/details/85125660