当前位置:网站首页>script之type=module
script之type=module
2022-07-23 07:29:00 【youhebuke225】
专栏目录请点击
- 在远古时代,我们引入js文件一般使用
<script src='路径'>来引入其他的js文件,但是随着js的规范化和模块化,在模块与模块之间的引入往往用import - 想要实现这种效果,我们可以在
script上增加一个type='module'
实例
目录

代码
script_model.html
<!DOCTYPE html>
<html lang="en">
<body>
<script type="module"> import {
sayHello} from "./index.js" sayHello() </script>
</body>
</html>
index.js
export const sayHello = () => {
console.log("Hello")
}
这样我就就会发现我们医用使用import来进行引入数据了
边栏推荐
- [Part 2] full analysis of oak-d+turnlebot3 robot project
- Optimising a 3D convolutional neural network for head and neck computed tomography segmentation with
- 【深入浅出玩转FPGA学习10------简单的Testbench设计】
- LeetCode_ 47_ Full arrangement II
- Typora 修改表格宽度
- 图像处理1:RGB888_YCbCr444
- LeetCode_ 51_ Queen n
- 【JS高级】正则入门基础—关于你想知道的正则表达式_01
- 微信小程序--动态设置导航栏颜色
- ES6 - weekly examination questions
猜你喜欢

These five points should be considered in the production of enterprise science and technology exhibition hall

Convergence of abnormal integral

LeetCode_ 491_ Longest increasing subsequence

Redis常用命令

Special lecture 5 combinatorial mathematics learning experience (long-term update)

去除标题栏

Power BI----综合应用

内存取证之NSSCTF-OtterCTF 2018(复现赛)

Power bi - Comprehensive Application

2022暑假软件创新实验室集训 项目实战1
随机推荐
内存取证之NSSCTF-OtterCTF 2018(复现赛)
Optimising a 3D convolutional neural network for head and neck computed tomography segmentation with
Qt Creator .pro文件根据kit添加对应库
【JS高级】正则入门基础—关于你想知道的正则表达式_01
[record] golang cross platform compilation
数据库系统原理与应用教程(042)—— MySQL 查询(四):使用通配符构造查询条件
General contents of radar introduction column
面试官:有了解过ReentrantLock的底层实现吗?说说看
反常积分的审敛
挖财开户风险性大吗,安全吗?
【Ardunio】2种方法控制舵机
freemarker
Detailed explanation of decision tree
一篇文章教会你使用kubernetes的基本使用
These five points should be considered in the production of enterprise science and technology exhibition hall
Convergence of abnormal integral
Research on hardware architecture of Ti single chip millimeter wave radar xwr1642
2022暑假软件创新实验室集训 项目实战1
【深入浅出玩转FPGA学习10------简单的Testbench设计】
LeetCode_2342_数位和相等数对的最大和