vue中のコンポーネントバインディングイベントについて説明します。nativeを追加しますか?
1658 ワード
コンポーネントバインディングイベントの場合
1.一般的なコンポーネントバインディングイベントは追加できません。native、追加後のイベントは無効になります。
2.カスタムコンポーネントバインディングイベントを追加する必要があります。native、そうでなければイベントは無効です。
1.一般的なコンポーネントバインディングイベントは追加できません。native、追加後のイベントは無効になります。
2.カスタムコンポーネントバインディングイベントを追加する必要があります。native、そうでなければイベントは無効です。
<template>
<!-- <mt-field label=" " placeholder=" "></mt-field> -->
<input type="text" @keyup.native="show($event)"> // .native,
</template>
<script>
import { MessageBox } from 'mint-ui';
export default {
name: 'about',
data(){
return{
}
},
methods:{
show(ev){
MessageBox.alert(' ').then(action => {
if(ev.keyCode==13){
console.log('enter');
}
});
}
}
}
</script>
<template>
<mt-field label=" " placeholder=" " @keyup.native="show($event)"></mt-field> // .native,
<!-- <input type="text" @keyup.native="show($event)"> -->
</template>
<script>
import { MessageBox } from 'mint-ui';
export default {
name: 'about',
data(){
return{
}
},
methods:{
show(ev){
MessageBox.alert(' ').then(action => {
if(ev.keyCode==13){
console.log('enter');
}
});
}
}
}
</script>
以上のように、vueのコンポーネントのバインディングイベントについて話していますが、nativeとは、小編集が皆さんに提供しているすべての内容です。参考にしていただければと思います。どうぞよろしくお願いします。