fix: front type check
Frontend CI / build-and-check (push) Has been cancelled
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 5s
🚀 Create and publish a Docker image / Build & publish backend image (push) Has been skipped
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 16s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 3s
Frontend CI / build-and-check (push) Has been cancelled
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 5s
🚀 Create and publish a Docker image / Build & publish backend image (push) Has been skipped
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 16s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 3s
This commit is contained in:
@@ -5,6 +5,8 @@ import pluginOxlint from 'eslint-plugin-oxlint'
|
|||||||
import skipFormatting from 'eslint-config-prettier/flat'
|
import skipFormatting from 'eslint-config-prettier/flat'
|
||||||
import vueScopedCss from 'eslint-plugin-vue-scoped-css'
|
import vueScopedCss from 'eslint-plugin-vue-scoped-css'
|
||||||
|
|
||||||
|
type VueTsConfig = Parameters<typeof defineConfigWithVueTs>[number]
|
||||||
|
|
||||||
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
// To allow more languages other than `ts` in `.vue` files, uncomment the following lines:
|
||||||
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
// import { configureVueProject } from '@vue/eslint-config-typescript'
|
||||||
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
// configureVueProject({ scriptLangs: ['ts', 'tsx'] })
|
||||||
@@ -20,7 +22,7 @@ export default defineConfigWithVueTs(
|
|||||||
|
|
||||||
...pluginVue.configs['flat/essential'],
|
...pluginVue.configs['flat/essential'],
|
||||||
vueTsConfigs.recommended,
|
vueTsConfigs.recommended,
|
||||||
...vueScopedCss.configs.recommended,
|
...(vueScopedCss.configs.recommended as VueTsConfig[]),
|
||||||
|
|
||||||
...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'),
|
...pluginOxlint.buildFromOxlintConfigFile('.oxlintrc.json'),
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,17 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
type Column = { key: string; label: string; align?: 'left' | 'center' | 'right' | string }
|
||||||
|
type DataTableSlotRow = Record<string, any>
|
||||||
|
|
||||||
defineProps<{
|
defineProps<{
|
||||||
columns: Array<{ key: string; label: string; align?: 'left' | 'center' | 'right' | string }>
|
columns: Column[]
|
||||||
rows: Record<string, unknown>[]
|
rows: Record<string, unknown>[]
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
|
defineSlots<Record<string, (props: { row: DataTableSlotRow; value: any }) => unknown>>()
|
||||||
|
|
||||||
|
function getCell(row: Record<string, unknown>, key: string) {
|
||||||
|
return row[key]
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -18,8 +27,8 @@ defineProps<{
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(row, i) in rows" :key="i">
|
<tr v-for="(row, i) in rows" :key="i">
|
||||||
<td v-for="col in columns" :key="col.key" :class="`align-${col.align ?? 'left'}`">
|
<td v-for="col in columns" :key="col.key" :class="`align-${col.align ?? 'left'}`">
|
||||||
<slot :name="col.key" :row="row" :value="row[col.key]">
|
<slot :name="col.key" :row="row" :value="getCell(row, col.key)">
|
||||||
{{ row[col.key] }}
|
{{ getCell(row, col.key) }}
|
||||||
</slot>
|
</slot>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Reference in New Issue
Block a user