File tree Expand file tree Collapse file tree 2 files changed +65
-19
lines changed Expand file tree Collapse file tree 2 files changed +65
-19
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <p >{{ state.messageTwo }}</p >
4
+ <div v-for =" item in items" :key =" item.id" class =" flex" >
5
+ <p >{{ item.title }}</p >
6
+ <p >{{ item.description }}</p >
7
+ <p >{{ item.isFinished }}</p >
8
+ </div >
9
+ </div >
10
+ </template >
11
+
12
+ <script lang="ts">
13
+ import { defineComponent , ref , reactive } from ' @vue/composition-api'
14
+
15
+ type ToDoItem = {
16
+ title: string
17
+ description: string
18
+ isFinished: boolean
19
+ }
20
+
21
+ export default defineComponent ({
22
+ setup() {
23
+ const items = ref <ToDoItem []>([
24
+ {
25
+ title: ' Welcome' ,
26
+ description: ' descriptionTest1' ,
27
+ isFinished: false
28
+ },
29
+ {
30
+ title: ' Welcome2' ,
31
+ description: ' descriptionTest2' ,
32
+ isFinished: true
33
+ },
34
+ {
35
+ title: ' Welcome3' ,
36
+ description: ' descriptionTest3' ,
37
+ isFinished: true
38
+ },
39
+ ])
40
+ const state = reactive <{ messageOne: string }>({
41
+ messageOne: " Hello"
42
+ });
43
+ const messageTwo = ref <string >(" こんにちは" );
44
+
45
+ return {
46
+ state ,
47
+ messageTwo ,
48
+ items
49
+ };
50
+ },
51
+ })
52
+ </script >
53
+ <style >
54
+ .NuxtLogo {
55
+ animation : 1s appear;
56
+ margin : auto ;
57
+ }
58
+
59
+ @keyframes appear {
60
+ 0% {
61
+ opacity : 0 ;
62
+ }
63
+ }
64
+ </style >
Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div class =" container" >
3
3
<div >
4
- <Logo />
5
4
<h1 class =" title" >nuxt-compostion-api-with-typescript</h1 >
6
- <div class =" links" >
7
- <a
8
- href =" https://nuxtjs.org/"
9
- target =" _blank"
10
- rel =" noopener noreferrer"
11
- class =" button--green"
12
- >
13
- Documentation
14
- </a >
15
- <a
16
- href =" https://github.com/nuxt/nuxt.js"
17
- target =" _blank"
18
- rel =" noopener noreferrer"
19
- class =" button--grey"
20
- >
21
- GitHub
22
- </a >
23
- </div >
5
+ <ToDo />
24
6
</div >
25
7
</div >
26
8
</template >
You can’t perform that action at this time.
0 commit comments