es6模块

<script type="module">
    // 引渠模块export.js
    import student from "./export.js";
    console.log(student)
    console.log(student.getInfo())

</script>

模块export.js

export default{
    name:"jack",
        age:11,
        getInfo(){
        return `姓名:${this.name},年龄:${this.age}`
    }
}

 

posted @ 2020-07-26 10:06  爱跑步的乌龟  阅读(161)  评论(0编辑  收藏  举报