Skip to content
This repository was archived by the owner on Dec 26, 2018. It is now read-only.

Commit 951ef59

Browse files
committed
update example to support enabled-prop
1 parent 9e0ae13 commit 951ef59

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

example/components.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
import Vue from 'vue'
22

33
Vue.component('container', {
4+
props: ['state'],
45
template: `
5-
<div class="container">
6+
<div class="container" :state="state">
67
<slot></slot>
78
</div>
89
`,
910
})
1011

1112
Vue.component('rotator', {
13+
props: ['state'],
1214
template: `
1315
<container>
1416
<v-touch
17+
:enabled="state"
1518
@rotatestart="start"
1619
@rotate="rotate"
1720
@doubletap="reset"

example/example.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ Vue.use(VueTouch)
2525
new Vue({
2626
el: '#app',
2727
data: {
28-
event: {}
28+
event: {},
29+
state: {rotate: true, doubletap: true}
2930
},
3031
methods: {
3132
test: function (e) {

example/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@
2323
</v-touch> -->
2424
<pre>{{event}}</pre>
2525

26-
<rotator>
26+
<rotator :state="state">
2727
rotate me!
2828
</rotator>
29+
<div>
30+
<button @click="state.doubletap = !state.doubletap"> ({{state.doubletap ? 'enabled' : 'disabled' }})</button>
31+
</div>
32+
<pre>{{$data}}</pre>
2933
</div>
3034
<script src="vendor.build.js"></script>
3135
<script src="example.build.js"></script>

0 commit comments

Comments
 (0)