JSFiddle - React, Tailwind, and code Playground
by leopoldthecuber
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/[email protected]/lib/index.js"></script>
<div id="app">
<template>
<el-input-number v-model="num1" @change="handleChange" :min="1" @keydown.native="handler"></el-input-number>
</template>
</div>
Babel + JSX
var Main = {
data() {
return {
num1: 1
};
},
methods: {
handleChange(value) {
console.log(value);
},
handler(e) {
const key = e.keyCode ? e.keyCode : e.which;
if (key === 190) {
e.preventDefault()
}
}
}
};
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')