File tree Expand file tree Collapse file tree 1 file changed +8
-15
lines changed
Expand file tree Collapse file tree 1 file changed +8
-15
lines changed Original file line number Diff line number Diff line change 1- <script setup lang="ts" generic =" TValue extends string , TGrid extends readonly (readonly TValue [])[]" >
2- import { type MaybeRef , unref } from ' vue' ;
3-
4- const getGridKey = (rowIndex : number , columnIndex : number ) =>
5- ` ${rowIndex }|${columnIndex } ` ;
6-
7- class Grid <TValue , TGrid extends readonly (readonly TValue [])[]> {
8- grid! : MaybeRef <TGrid >;
9- }
10-
11- const { grid } = defineProps <{
12- grid: Grid <TValue , TGrid >;
13- }>();
1+ <script setup lang="ts" generic =" T extends string , TGrid extends readonly (readonly T [])[]" >
2+ import { exactType } from ' ../shared' ;
143 </script >
154
165<template >
17- <template v-for =" (row , rowIndex ) of unref (grid .grid ) " :key =" rowIndex " >
18- <div v-for =" (_text, columnIndex) of row" :key =" getGridKey(rowIndex, columnIndex)" />
6+ <template v-for =" (row , rowIndex ) of ({} as TGrid ) " >
7+ {{ exactType(rowIndex, {} as number) }}
8+ <template v-for =" (col , columnIndex ) of row " >
9+ {{ exactType(col, {} as T) }}
10+ {{ exactType(columnIndex, {} as number) }}
11+ </template >
1912 </template >
2013</template >
You can’t perform that action at this time.
0 commit comments