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.

42 lines
998 B
TypeScript

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