vue-directive-extend
v0.1.5
Published
This project is used to extend more event listener for Vue.
Downloads
17
Maintainers
Readme
NPM
npm install --save vue-directive-extend
Usage
In
main.js
files.
import Vue from 'vue'
import App from './App.vue'
import vueDirectiveExtend from 'vue-directive-extend'
Vue.use(vueDirectiveExtend)
Vue.config.productionTip = false
new Vue({
render: h => h(App),
}).$mount('#app')
In
.vue
files.
<template lang="html">
<div class="demoVue">
<div class="test" v-resize="onResize" v-mousewheel="onMousewheel"></div>
</div>
</template>
<script>
export default {
name: 'demo',
methods: {
onResize () {
console.log('onResize')
},
onMousewheel (e) {
console.log(e)
}
}
}
</script>
<style lang="scss" scoped>
</style>