import { createApp, defineComponent, reactive } from 'vue'; export const App = defineComponent({ setup() { const state = reactive({ table: 'hero' as string, keys: [] as string[], picked: '' as string, detail: '' as string }); async function load() { const keys = await Editor.Message.request('pixelhero-config-editor', 'query-keys', state.table); state.keys = keys || []; state.picked = ''; state.detail = ''; } async function pick(k: string) { state.picked = k; const v = await Editor.Message.request('pixelhero-config-editor', 'query-record', state.table, k); state.detail = JSON.stringify(v, null, 2); } load(); return { state, load, pick }; }, template: `
{{ state.detail }}