mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-30 00:23:38 +08:00
Load sign-in assets in the initial graph and defer the workspace, demo features, and mock client until needed. Split feature dependencies and clear stale files from the default production output. Document feature entry points for runtime imports and record the browser and Harness results.
37 lines
946 B
TypeScript
37 lines
946 B
TypeScript
import { useI18n } from '@/hooks/template/useI18n'
|
|
import { RTablePro } from '@ray-template/ui/table-pro'
|
|
import { createPeopleColumns } from './people'
|
|
import { usePeopleData } from './usePeopleData'
|
|
|
|
export default defineComponent({
|
|
name: 'TableDemoBasic',
|
|
setup() {
|
|
const { t } = useI18n('table')
|
|
const { data, loading } = usePeopleData(() => ({ page: 1, pageSize: 10 }))
|
|
const columns = computed(() =>
|
|
createPeopleColumns(t).map((column) => {
|
|
if ('key' in column && column.key === 'age')
|
|
return {
|
|
...column,
|
|
sorter: (
|
|
a: (typeof data.value)[number],
|
|
b: (typeof data.value)[number],
|
|
) => a.age - b.age,
|
|
}
|
|
|
|
return column
|
|
}),
|
|
)
|
|
|
|
return () => (
|
|
<RTablePro
|
|
bare
|
|
data={data.value}
|
|
loading={loading.value}
|
|
columns={columns.value}
|
|
scrollX={944}
|
|
/>
|
|
)
|
|
},
|
|
})
|