2
0
mirror of https://github.com/tenrok/vue-context.git synced 2026-06-06 02:12:23 +03:00

Test event emitting

This commit is contained in:
Randall Wilk
2018-10-15 08:59:35 -05:00
parent d157ffc746
commit 604aaa9c1d
4 changed files with 18 additions and 7 deletions
+5 -2
View File
@@ -10,7 +10,10 @@
Right click on me
</p>
<vue-context ref="menu" :close-on-scroll="close" :close-on-click="false">
<vue-context ref="menu" :close-on-scroll="close"
@close="onClose"
@open="onOpen"
>
<ul slot-scope="child">
<li @click="onClick(child.data)">Option 1 {{ child.data && child.data.foo }}</li>
<li>Option 2</li>
@@ -20,4 +23,4 @@
<script src="js/dist/index.js"></script>
</body>
</html>
</html>
+2 -2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+10 -2
View File
@@ -12,7 +12,15 @@ new Vue({
methods: {
onClick (data) {
console.log(data);
// console.log(data);
},
onClose () {
console.log('closing');
},
onOpen (event, data, top, left) {
console.log(data, top, left);
}
},
}).$mount('#app');
}).$mount('#app');