Skip to content

Commit

Permalink
Fix api-demo api
Browse files Browse the repository at this point in the history
  • Loading branch information
linroid committed Dec 9, 2019
1 parent 3620430 commit c109a1c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 11 deletions.
8 changes: 6 additions & 2 deletions api_demo/components/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ module.exports = {
type: 'list',
actions: [{
id: 'update_menu',
title: 'Menu',
title: 'Update title',
onClick: async () => {
let newTitle = await $ui.prompt('Update title', 'new title', this.title)
let newTitle = await $input.prompt({
title: 'Update title',
hint: 'new title',
value: this.title
})
this.title = newTitle
},
asAction: false
Expand Down
2 changes: 1 addition & 1 deletion api_demo/components/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
onClick: () => {
console.log($ui)
if (stat.isDirectory()) {
$ui.navTo($route('file', {
$router.to($route('file', {
path: file
}))
} else {
Expand Down
6 changes: 5 additions & 1 deletion api_demo/components/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ module.exports = {
onClick: async (menu) => {
console.log(menu)
console.log(this)
let color = await $ui.prompt('Set color', 'color', this.color())
let color = await $input.prompt({
title: 'Set color',
hint: 'color',
value: this.color()
})
$storage.put('icon_color', color)
this.refresh()
},
Expand Down
4 changes: 3 additions & 1 deletion api_demo/components/types/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
}
},
startDanmaku() {
console.log('startDanmaku')
var seq = 0
this.danmuScheduler = setInterval(() => {
seq++;
Expand All @@ -19,7 +20,8 @@ module.exports = {
}, 100)
},
stopDanmaku() {
clearInterval(this.clearInterval)
console.log('stopDanmaku')
clearInterval(this.danmuScheduler)
},
sendDanmaku(message) {
$ui.toast(`send ${message}`)
Expand Down
4 changes: 3 additions & 1 deletion api_demo/components/types/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ module.exports = {
}, {
title: "Redirect",
onClick: async () => {
let newUrl = await $ui.prompt("Url")
let newUrl = await $ui.prompt({
title: "Url"
})
this.redirect(newUrl)
}
}, {
Expand Down
9 changes: 4 additions & 5 deletions api_demo/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"uuid": "2f33d8de-c474-4f38-a19b-cf2cab4228cc",
"name": "@dora-addon/api-demo",
"name": "@dora.js/api-demo",
"displayName": "API Demo",
"version": "1.2.1",
"version": "1.3.0",
"description": "在这里可以快速体验 Dora.js 提供的各种 API",
"license": "MIT",
"author": {
Expand All @@ -12,10 +12,9 @@
"dora": ">=1.0.0"
},
"keywords": [
"Dora",
"dora-addon"
"Dora.js"
],
"icon": "assets/icon.png",
"main": "main.js",
"dependencies": {}
}
}

0 comments on commit c109a1c

Please sign in to comment.