Skip to content

Commit 51a6eae

Browse files
committed
feat: 修改了代码段
1 parent 28a07fd commit 51a6eae

5 files changed

Lines changed: 832 additions & 6 deletions

File tree

codes/demo/plugins/datetime-picker/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ class DateTimePicker {
145145
const todayBtn = document.createElement("button");
146146
todayBtn.className = "datetime-btn today";
147147
todayBtn.textContent = "今天";
148-
149148
const confirmBtn = document.createElement("button");
150149
confirmBtn.className = "datetime-btn confirm";
151150
confirmBtn.textContent = "确定";
@@ -544,4 +543,4 @@ class DateTimePicker {
544543
?.setAttribute("name", forName);
545544
}
546545
}
547-
}
546+
}

codes/demo/plugins/input-number/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class InputNumber {
2424

2525
const decreaseBtn = document.createElement("button");
2626
decreaseBtn.className = "input-number-button decrease";
27+
decreaseBtn.setAttribute("type", "button");
2728
decreaseBtn.innerHTML = "-";
2829

2930
const input = document.createElement("input");
@@ -34,6 +35,7 @@ class InputNumber {
3435
const increaseBtn = document.createElement("button");
3536
increaseBtn.className = "input-number-button increase";
3637
increaseBtn.innerHTML = "+";
38+
increaseBtn.setAttribute("type", "button");
3739

3840
container.appendChild(decreaseBtn);
3941
container.appendChild(input);

codes/javascript/head.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
const head = arr => (Array.isArray(arr) && arr.length ? arr[0] : void 0);
1212
```
1313

14+
ts 代码如下:
15+
16+
<div class="code-editor" data-url="codes/javascript/ts/head.ts" data-language="typescript"></div>
17+
1418
> 调用方式:
1519
1620
```js
@@ -22,6 +26,8 @@ head(undefined); // undefined
2226

2327
> 应用场景
2428
29+
以下是一个实战<a href="codes/javascript/html/head.html" target="_blank" rel="noopener noreferrer">示例</a>:
30+
2531
<div class="code-editor" data-url="codes/javascript/html/head.html" data-language="html"></div>
2632

2733
结果如下:

0 commit comments

Comments
 (0)