已更新至前端模块化ES6

This commit is contained in:
3056762376@qq.com 2022-11-12 17:17:47 +08:00
parent bb364d24c1
commit 56ea87a4e1
3 changed files with 15 additions and 8 deletions

View File

@ -10,4 +10,9 @@ function tj(n1,n2){
} }
export{ export{
pd,doing,tj pd,doing,tj
} }
let names=function(){
return "你的名字是linda";
}
export default names

View File

@ -1,7 +1,9 @@
import { pd,doing,tj } from "./Select_one.js"; import * as info from "./Select_one.js";
console.log(doing('张三','44')); console.log(info.doing('张三','44'));
console.log(tj(20,10)); console.log(info.tj(20,10));
import { content } from "./Use_one.js"; import { content } from "./Use_one.js";
console.log(content); console.log(content);
import { fun } from "./Use_one.js"; import { fun } from "./Use_one.js";
console.log(fun()); console.log(fun());
import fun_name from "./Select_one.js";
console.log(fun_name());

View File

@ -1,4 +1,4 @@
import { pd,doing } from "./Select_one.js"; import * as dos from "./Select_one.js";
function doings(pd){ function doings(pd){
if (pd == true) { if (pd == true) {
console.log(`${name}我在做作业`); console.log(`${name}我在做作业`);
@ -6,8 +6,8 @@ function doings(pd){
console.log('你好呀'); console.log('你好呀');
} }
} }
console.log(doing("小小", "22")); console.log(dos.doing("小小", "22"));
console.log(pd); console.log(dos.pd);
export let content="你好啊webpack" export let content="你好啊webpack"
export function fun() { export function fun() {
let name="张三" let name="张三"