es6 模块导入导出
发布时间:2023-02-06 22:27:05 300
相关标签: # html
b.js
export function fun(){
console.log("fun1")
}
export let person = {
name:"devin",
age:12
}
c.js
let a = 12
let fun = function(){
console.log("function")
}
export default{
a,fun
}
index.html
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Titletitle>
head>
<body>
<script type="module" >
// import * as util from './a.js';
// //import {fun, person} from "./a.js";
// console.log(util.fun(),util.person)
// import a from './exportDefault';
// a.show();
// console.log(a.a);
// import * as util from "./b.js"
import c from "./c.js"
// console.log(util.fun)
console.log(c.a)
c.fun()
script>
body>
html>
文章来源: https://blog.51cto.com/u_15704977/5444452
特别声明:以上内容(图片及文字)均为互联网收集或者用户上传发布,本站仅提供信息存储服务!如有侵权或有涉及法律问题请联系我们。
举报