obsidian-test-vault/ui/task.md

17 lines
515 B
Markdown
Raw Permalink Normal View History

2024-11-02 18:14:58 -04:00
```datacorejsx
return function View() {
const q = dc.useQuery(`@task and startswith($file, "data/02 - ") and regexreplace($cleantext, "^\\s+|\\s+$", "") != "" and $parentLine < 0`, {debounce: 10});
const sq = dc.useMemo(() => q.sort((a, b) => a.$cleantext > b.$cleantext ? 1 : a.$cleantext < b.$cleantext ? -1 : 0), [q])
const fields = [{
type: "string",
renderAs: "raw",
key: "field",
editable: true,
defaultValue: null
}]
return (<>
<dc.TaskList rows={sq} displayedFields={fields}/>
</>)
}
```