This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.vue
53 lines (50 loc) · 1.44 KB
/
demo.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
<template>
<div className="container" style="padding-top: 1%;">
<p>The current value of text is: {{text}}</p>
<SuggestKit
:suggestions="this.$data.suggestions" placeholder="Type here to get suggestions!"
@on-suggestions-change="suggestionsToRender => this.$data.suggestionsToRender = suggestionsToRender"
@on-text-change="text => this.$data.text = text"
>
<template>
<div v-for="(suggestion, index) in this.$data.suggestionsToRender" v-bind:key="index">
<hr />
<h1 class="title">{{suggestion.title}}</h1>
<h2 class="subtitle">{{suggestion.description}}</h2>
</div>
</template>
</SuggestKit>
</div>
</template>
<script>
import SuggestKit from "./src";
const suggestions = [
{
key: "hello",
info: {
title: "Hello World",
description: "Demo",
},
},
{
key: "sammy",
info: {
title: "Sammy Shark!",
description: "Sammy!",
},
},
];
export default {
name: "Demo",
components: {
SuggestKit,
},
data() {
return {
suggestions,
suggestionsToRender: [],
text: "",
}
},
}
</script>