forked from LucienLee/vue-tag-input
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathApp.vue
57 lines (53 loc) · 1.17 KB
/
App.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
<template>
<div class="container">
<span>Outside a Form</span>
<VueTagInput
v-model="tags"
:suggestions="suggestions"
:allow-duplicates="false"
:only-from-suggestions="false"
:quick-mode="true"
/>
<br>
<span>Inside a Form</span>
<form>
<input
v-model="preventDefaultOnEnter"
type="checkbox">Prevent default on enter
<VueTagInput
v-model="tags"
:suggestions="suggestions"
:allow-duplicates="false"
:only-from-suggestions="false"
:quick-mode="true"
:prevent-default-on-enter="preventDefaultOnEnter"
/>
</form>
</div>
</template>
<script>
import VueTagInput from '@/VueTagInput';
export default {
components: {
VueTagInput,
},
data() {
return {
tags: [],
suggestions: ['Japan', 'Taiwan', 'Africa', 'America', 'Canada', 'Finland', 'China'],
// suggestions: ['中國', '中文', '中午', '中飯'],
preventDefaultOnEnter: true,
};
},
};
</script>
<style lang="sass">
// style for development playgrond
body
margin: 0
padding: 0
.container
margin: 30px auto
width: 100%
max-width: 600px
</style>