-
Notifications
You must be signed in to change notification settings - Fork 0
/
serve.vue
114 lines (106 loc) · 2.21 KB
/
serve.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<script lang="ts">
import {
defineComponent,
onMounted,
ref
} from 'vue'
import Vue3SimpleChip from '@/vue3-simple-chip.vue'
interface IUser {
id: number;
username: string;
}
export default defineComponent({
name: 'ServeDev',
components: {
Vue3SimpleChip
},
setup() {
const users = ref<IUser[]>([])
const fetchPosts = () => {
fetch('https://jsonplaceholder.typicode.com/users')
.then((response) => response.json())
.then((data) => {
users.value = data
})
.catch((e) => {
console.log(e)
})
}
onMounted(() => {
fetchPosts()
})
return {
users
}
}
})
</script>
<template>
<div id="app">
<div class="vue3-simple-chips">
<vue3-simple-chip
label="Default"
/>
<vue3-simple-chip
label="Primary and secondary color"
primary-color="teal"
secondary-color="white"
/>
<vue3-simple-chip
label="Outlined"
primary-color="teal"
secondary-color="white"
outlined
/>
<vue3-simple-chip
label="Rounded"
primary-color="#ffeb3b"
secondary-color="black"
rounded
/>
<vue3-simple-chip
label="Dot color"
primary-color="teal"
secondary-color="white"
dot-color="red"
outlined
/>
<vue3-simple-chip
label="Left icon"
>
<template #left-icon>
<img src="./assets/icons/search.svg" alt="">
</template>
</vue3-simple-chip>
<vue3-simple-chip
label="Right icon"
>
<template #right-icon>
<img src="./assets/icons/search.svg" alt="">
</template>
</vue3-simple-chip>
<vue3-simple-chip
label="Use button"
use-button
/>
</div>
</div>
</template>
<style scoped>
#app {
font-family: "Open Sans", Arial, sans-serif;
font-size: 16px;
line-height: 18px;
}
.vue3-simple-chips {
display: flex;
align-items: flex-start;
justify-content: flex-start;
flex-wrap: wrap;
max-width: 600px;
padding: 16px 8px 8px 16px;
margin: 40px auto;
border: 1px solid #ccc;
border-radius: 8px;
}
</style>