Skip to content

Commit 721e5bf

Browse files
authored
Add files via upload
1 parent 4d748c0 commit 721e5bf

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

模块化 JSON/test.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Document</title>
7+
</head>
8+
<body></body>
9+
<script type="module">
10+
import json from './test.json' with { type: "json" }
11+
12+
console.log(json);
13+
</script>
14+
</html>

模块化 JSON/test.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"name": "张三"
3+
}

模块化 JSON/test.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import json from './test.json' with { type: "json" }
2+
3+
console.log(json);

0 commit comments

Comments
 (0)