JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui/lib/index.js"></script>
<div id="app">
<template>
<div>
<p>原生input: {{input1}} </p>
<input v-model.lazy="input1" @change="handleNative" @keyup.enter="handleNative">
</div>
<div>
<p>
Element input: {{input2}}
</p>
<el-input v-model.lazy="input2" @change="handleEle" @keyup.ente="handlerEle"></el-input>
</div>
</template>
</div>
SCSS
@import url("//unpkg.com/element-ui/lib/theme-default/index.css");
Babel + JSX
var Main = {
data(){
return {
input1: '',
input2: '',
}
},
methods: {
handleNative(what){
console.log('native', what , this.input1);
},
handleEle(what){
console.log('ele', what , this.input2);
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')