Skip to content

Instantly share code, notes, and snippets.

@simplesmiler
Created April 8, 2018 18:00
Show Gist options
  • Save simplesmiler/b4f1c29cc5251d574014d85c44478e66 to your computer and use it in GitHub Desktop.
Save simplesmiler/b4f1c29cc5251d574014d85c44478e66 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- @NOTE: when it looks like iOS caches the pages, change the bust value and see if you are getting a fresh page -->
<meta charset="UTF-8">
<title>VueClickaway test</title>
<script src="https://unpkg.com/vue@2.5.16?bust=1"></script>
<script src="https://unpkg.com/vue-clickaway@2.2.1/dist/vue-clickaway.min.js?bust=1"></script>
</head>
<body>
<div id="app">
<p>Random text above, bust=1</p>
<p @click="click" v-on-clickaway="away">Target</p>
<p>Random text bellow</p>
</div>
<script>
var vm = new Vue({
mixins: [VueClickaway.mixin],
el: '#app',
methods: {
click: function() {
alert('Click!');
},
away: function() {
alert('Away!');
},
},
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment