Update Create button in the controls.md

This commit is contained in:
zhw2590582 committed 2021-11-28 13:35:53 +08:00
1 parent c79b41b224
commit 480c3b539f
1 file changed
+3 -1
@@ -8,6 +8,7 @@ sidebar_position: 2
<div className="run-code">▶ Run Code</div> <div className="run-code">▶ Run Code</div>
```js ```js
var time = 0;
var art = new Artplayer({ var art = new Artplayer({
container: '.artplayer-app', container: '.artplayer-app',
url: '/assets/sample/video.mp4', url: '/assets/sample/video.mp4',
@@ -17,7 +18,8 @@ var art = new Artplayer({
html: '<button type="button">Click Me!</button>', html: '<button type="button">Click Me!</button>',
click: function (_, event) { click: function (_, event) {
// 第二个参数是事件对象 // 第二个参数是事件对象
event.target.innerText = 'You Clicked'; time += 1;
event.target.innerText = 'You Click ' + time;
}, },
}, },
], ],