Skip to content

Commit d162f3b

Browse files
committed
doc: update docs/htmx.md #1042
1 parent 406f7ef commit d162f3b

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

docs/htmx.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
---
99

1010
### 安装
11-
<!--rehype:wrap-class=row-span-2-->
11+
<!--rehype:wrap-class=col-span-2 row-span-2-->
1212

1313
:-- | --
1414
:-- | --
15-
CDN | `<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.10/dist/htmx.min.js"></script>`
1615
下载文件 | 下载 `htmx.min.js` 后用普通 `<script>` 引入
1716
npm | `npm install htmx.org@2.0.10`
1817
Webpack / bundler | `import "htmx.org";`
@@ -22,6 +21,10 @@ Webpack / bundler | `import "htmx.org";`
2221

2322
htmx 2.x 是当前主线;1.x 仍支持 IE11。生产环境使用 CDN 时建议固定版本,并按官方下载页更新 `integrity` 值。
2423

24+
```html
25+
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.10/dist/htmx.min.js"></script>
26+
```
27+
2528
### 第一个请求
2629

2730
```html
@@ -49,7 +52,7 @@ htmx 2.x 是当前主线;1.x 仍支持 IE11。生产环境使用 CDN 时建议
4952
---
5053

5154
### hx-trigger
52-
<!--rehype:wrap-class=row-span-2-->
55+
<!--rehype:wrap-class=col-span-2-->
5356

5457
:-- | --
5558
:-- | --
@@ -98,7 +101,7 @@ htmx 2.x 是当前主线;1.x 仍支持 IE11。生产环境使用 CDN 时建议
98101
```
99102

100103
### hx-swap
101-
<!--rehype:wrap-class=row-span-2-->
104+
<!--rehype:wrap-class=col-span-2-->
102105

103106
:-- | --
104107
:-- | --
@@ -215,6 +218,8 @@ htmx 2.x 是当前主线;1.x 仍支持 IE11。生产环境使用 CDN 时建议
215218
</tbody>
216219
```
217220

221+
---
222+
218223
```css
219224
tr.htmx-swapping td {
220225
opacity: 0;
@@ -223,6 +228,7 @@ tr.htmx-swapping td {
223228
```
224229

225230
### 延迟加载与轮询
231+
<!--rehype:wrap-class=col-span-2-->
226232

227233
```html
228234
<div hx-get="/graph" hx-trigger="load">
@@ -357,7 +363,6 @@ Class | 说明
357363
`HX-Trigger` | 触发元素 id
358364

359365
### 响应头
360-
<!--rehype:wrap-class=row-span-2-->
361366

362367
标头 | 说明
363368
:- | --
@@ -377,6 +382,7 @@ Class | 说明
377382
---
378383

379384
### 扩展
385+
<!--rehype:wrap-class=col-span-2-->
380386

381387
:-- | --
382388
:-- | --
@@ -403,6 +409,7 @@ Network 面板 | 查看 `HX-*` 请求头和响应头
403409
<!--rehype:className=left-align-->
404410

405411
### 全局配置
412+
<!--rehype:wrap-class=col-span-3-->
406413

407414
```html
408415
<meta name="htmx-config" content='{"defaultSwapStyle":"outerHTML"}'>

0 commit comments

Comments
 (0)