You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.0 KiB
TypeScript

/*
* app.ts
* Copyright (C) 2024 veypi <i@veypi.com>
* 2024-10-23 15:35
* Distributed under terms of the GPL license.
*/
4 weeks ago
import { v, proxy, vfor } from "../v2dom";
import logic from '../logic'
4 weeks ago
import api from "../api";
import * as typs from "../typs"
4 weeks ago
export default () => {
let apps: typs.App[] = proxy.Watch([])
api.app.List({}).then(e => {
apps.push(...e)
})
return v({
class: 'voa-apps',
children: [
v('voa-apps-header', [v('voa-apps-title', '我的应用')]),
v('voa-apps-body', [
4 weeks ago
vfor(apps,
(data, idx) => v('voa-apps-box', [v('span', () => idx + ': ' + data.name)])),
// [logic.myapps,
// (data) => v('voa-app-box', () => data.name)],
4 weeks ago
v({
4 weeks ago
typ: 'div', children: ['add'], vbind: [logic.myapps[0], 'name'],
4 weeks ago
onclick: () => {
4 weeks ago
// let tmp = apps[1]
// apps[1] = apps[0]
// apps[0] = tmp
// apps.splice(2, 1)
apps.push({ name: new Date().toLocaleTimeString() } as any)
4 weeks ago
}
})
])
]
})
}