File tree Expand file tree Collapse file tree 4 files changed +73
-0
lines changed Expand file tree Collapse file tree 4 files changed +73
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ import '@vue/runtime-core'
6
6
declare module '@vue/runtime-core' {
7
7
export interface GlobalComponents {
8
8
AppButton : typeof import ( './src/components/AppButton.vue' ) [ 'default' ]
9
+ AppImage : typeof import ( './src/components/AppImage.vue' ) [ 'default' ]
10
+ BoardCard : typeof import ( './src/components/BoardCard.vue' ) [ 'default' ]
9
11
RouterLink : typeof import ( 'vue-router' ) [ 'RouterLink' ]
10
12
RouterView : typeof import ( 'vue-router' ) [ 'RouterView' ]
11
13
}
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <img v-bind =" $attrs" />
3
+ </template >
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import {
3
+ Card as KCard ,
4
+ CardTitle as KCardTitle ,
5
+ } from " @progress/kendo-vue-layout" ;
6
+ import type { Board } from " @/types" ;
7
+ defineProps <{
8
+ board: Board ;
9
+ }>();
10
+ const randomColor = " #" + Math .floor (Math .random () * 16777215 ).toString (16 );
11
+ </script >
12
+ <template >
13
+ <router-link :to =" `/boards/${board.id}`" class =" block w-96" >
14
+ <KCard class =" m-5" >
15
+ <AppImage
16
+ v-if =" board.image"
17
+ :src =" board.image?.downloadUrl"
18
+ width =" 384"
19
+ class =" aspect-video w-full"
20
+ />
21
+ <div
22
+ v-else
23
+ class =" aspect-video w-full"
24
+ :style =" { backgroundColor: randomColor }"
25
+ ></div >
26
+ <KCardTitle class =" p-2" >
27
+ <span class =" text-gray-700 text-xl" >{{ board.title }}</span >
28
+ </KCardTitle >
29
+ </KCard >
30
+ </router-link >
31
+ </template >
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ import type { Board } from " @/types" ;
3
+ import { ref } from " vue" ;
4
+ const boards = ref <Partial <Board >[]>([
5
+ {
6
+ id: " 1" ,
7
+ title: " My First Board" ,
8
+ order: " []" ,
9
+ image: {
10
+ downloadUrl: " https://picsum.photos/480/270?board=1" ,
11
+ },
12
+ },
13
+ {
14
+ id: " 2" ,
15
+ title: " My Second Board" ,
16
+ order: " []" ,
17
+ image: {
18
+ downloadUrl: " https://picsum.photos/480/270?board=2" ,
19
+ },
20
+ },
21
+ {
22
+ id: " 3" ,
23
+ title: " My Third Board" ,
24
+ order: " []" ,
25
+ },
26
+ ]);
27
+ </script >
28
+
29
+ <template >
30
+ <h1 class =" text-3xl mb-5" >Boards</h1 >
31
+ <div class =" flex" >
32
+ <BoardCard v-for =" board in boards" :key =" board.id" :board =" board" />
33
+ <button class =" text-gray-500" @click =" createBoard(newBoardTemplate)" >
34
+ <span >New Board +</span >
35
+ </button >
36
+ </div >
37
+ </template >
You can’t perform that action at this time.
0 commit comments