This repository has been archived by the owner on Jan 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
91 lines (82 loc) · 2.85 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vue Inline Data - Demo</title>
<link
href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
rel="stylesheet"
/>
<script src="https://unpkg.com/vue@2.6" defer></script>
<script src="./dist/vue-inline-data.min.js" defer></script>
</head>
<body class="max-w-lg mx-auto py-10 px-2">
<div class="mb-12">
<div class="mb-2"><span class="border-4 border-red-500 w-10 inline-block"></span> Vue Instance (Root)</div>
<div> <span class="border-4 border-orange-500 w-10 inline-block"></span> Nested Vue Component</div>
</div>
</div>
<div
vi-data="{ value : 0 , title : document.title, }"
class="border-4 border-red-500 p-4"
>
<div class="flex justify-between">
<input
type="number"
v-model.number="value"
class="px-5 py-2 bg-gray-100 rounded mr-4 border border-gray-200 flex-1"
/>
<button
@click="value ++"
class="py-2 px-4 bg-gray-800 text-white text-sm rounded shadow"
>
Increment
</button>
</div>
<input
type="text"
v-model="title"
class="px-5 py-2 bg-gray-100 rounded mt-4 border border-gray-200 flex-1"
/>
<div
vi-data
vi-name="Test"
vi-props="['title']"
:title="title"
class="border-4 border-orange-500 mt-4 p-4"
>
{{ title }}
</div>
</div>
<script>
// for testing
localStorage.removeItem("hide-cookie-banner");
</script>
<div
class="container mx-auto fixed inset-x-0 bottom-0 mb-8 border-4 border-red-500 rounded-lg overflow-hidden"
vi-data="{ show : !localStorage.getItem('hide-cookie-banner'), confirm : () => { localStorage.setItem('hide-cookie-banner',true); this.show = false;}}"
v-show="show"
>
<div
class="py-3 pl-6 pr-3 bg-gray-900 shadow-lg w-full flex items-center justify-between"
>
<span class="text-gray-200 truncated font-medium">
This site uses cookies.
<span class="hidden md:inline-block font-normal"
>By continuing to use this website, you agree to their use.</span
>
<span class="text-red-500">(Demo - Vue Inline Instance)</span>
</span>
<div class="rounded-md shadow-sm">
<a
@click="confirm"
class="cursor-pointer flex items-center justify-center px-4 py-2 border border-transparent text-sm leading-5 font-medium rounded text-gray-900 bg-white hover:text-gray-600 focus:outline-none focus:shadow-outline transition ease-in-out duration-150"
>
I Understand
</a>
</div>
</div>
</div>
</body>
</html>