From 56ea87a4e176330cdec6cbe952b8d637b09a2dd2 Mon Sep 17 00:00:00 2001 From: "3056762376@qq.com" <3056762376@qq.com> Date: Sat, 12 Nov 2022 17:17:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=B2=E6=9B=B4=E6=96=B0=E8=87=B3=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=A8=A1=E5=9D=97=E5=8C=96ES6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02-ES6模块化的实现/Select_one.js | 7 ++++++- .../02-ES6模块化的实现/Select_two.js | 10 ++++++---- .../02-ES6模块化的实现/Use_one.js | 6 +++--- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/11-前端模块化开发/02-ES6模块化的实现/Select_one.js b/11-前端模块化开发/02-ES6模块化的实现/Select_one.js index f757580..051ca0a 100644 --- a/11-前端模块化开发/02-ES6模块化的实现/Select_one.js +++ b/11-前端模块化开发/02-ES6模块化的实现/Select_one.js @@ -10,4 +10,9 @@ function tj(n1,n2){ } export{ pd,doing,tj -} \ No newline at end of file +} + +let names=function(){ + return "你的名字是linda"; +} +export default names diff --git a/11-前端模块化开发/02-ES6模块化的实现/Select_two.js b/11-前端模块化开发/02-ES6模块化的实现/Select_two.js index cc3e231..6848fc9 100644 --- a/11-前端模块化开发/02-ES6模块化的实现/Select_two.js +++ b/11-前端模块化开发/02-ES6模块化的实现/Select_two.js @@ -1,7 +1,9 @@ -import { pd,doing,tj } from "./Select_one.js"; -console.log(doing('张三','44')); -console.log(tj(20,10)); +import * as info from "./Select_one.js"; +console.log(info.doing('张三','44')); +console.log(info.tj(20,10)); import { content } from "./Use_one.js"; console.log(content); import { fun } from "./Use_one.js"; -console.log(fun()); \ No newline at end of file +console.log(fun()); +import fun_name from "./Select_one.js"; +console.log(fun_name()); \ No newline at end of file diff --git a/11-前端模块化开发/02-ES6模块化的实现/Use_one.js b/11-前端模块化开发/02-ES6模块化的实现/Use_one.js index d563239..a30ea78 100644 --- a/11-前端模块化开发/02-ES6模块化的实现/Use_one.js +++ b/11-前端模块化开发/02-ES6模块化的实现/Use_one.js @@ -1,4 +1,4 @@ -import { pd,doing } from "./Select_one.js"; +import * as dos from "./Select_one.js"; function doings(pd){ if (pd == true) { console.log(`${name}我在做作业`); @@ -6,8 +6,8 @@ function doings(pd){ console.log('你好呀'); } } -console.log(doing("小小", "22")); -console.log(pd); +console.log(dos.doing("小小", "22")); +console.log(dos.pd); export let content="你好啊,webpack" export function fun() { let name="张三"