-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae874cc
commit 643e816
Showing
17 changed files
with
526 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,48 @@ | ||
<!--<script setup lang="ts">--> | ||
<!-- import type {PropType} from "vue";--> | ||
<script setup lang="ts"> | ||
import type {PropType} from "vue"; | ||
<!-- const props = defineProps({--> | ||
<!-- data: {--> | ||
<!-- type: Array as PropType<any[]>,--> | ||
<!-- required: true--> | ||
<!-- },--> | ||
<!-- columns: {--> | ||
<!-- type: Array as PropType<any[]>,--> | ||
<!-- required: true--> | ||
<!-- },--> | ||
<!-- options: {--> | ||
<!-- type: Object as PropType<any>,--> | ||
<!-- default: () => ({})--> | ||
<!-- }--> | ||
<!-- })--> | ||
<!--</script>--> | ||
type column = { | ||
name: string, | ||
key: string | ||
} | ||
<!--<template>--> | ||
<!-- <table class="table">--> | ||
<!-- <!– head –>--> | ||
<!-- <thead>--> | ||
<!-- <tr>--> | ||
<!-- <th>Name</th>--> | ||
<!-- </tr>--> | ||
<!-- </thead>--> | ||
<!-- <tbody>--> | ||
const props = defineProps({ | ||
data: { | ||
type: Array as PropType<any[]>, | ||
required: true | ||
}, | ||
columns: { | ||
type: Array as PropType<column[]>, | ||
required: true | ||
}, | ||
<!-- <tr v-for="(clan, index) in data"--> | ||
<!-- :key="index">--> | ||
<!-- <th>{{clan.name}}</th>--> | ||
}) | ||
</script> | ||
|
||
<!-- </tr>--> | ||
<template> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th v-for="(column, index) in props.columns" | ||
:key="index">{{ column.name }}</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<tr v-for="(item, index) in data" | ||
:key="index"> | ||
<th v-for="(column, index) in props.columns" | ||
:key="index"> | ||
<slot name="row-item" | ||
:column="column" | ||
:item="item"> | ||
{{ item[column.key] }} | ||
</slot> | ||
</th> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> | ||
|
||
<!-- </tbody>--> | ||
<!-- </table>--> | ||
<!--</template>--> | ||
<style scoped> | ||
<!--<style scoped>--> | ||
|
||
<!--</style>--> | ||
</style> |
Oops, something went wrong.