DEV Community

ChuangWANG
ChuangWANG

Posted on

Vue3.0 & Vue2.0

Vue 3:

in vue2 the syntic si right:
@keyup.enter.native="dataFormSubmit()
vue 回车触发聚焦 @keyup.enter.native
12:84  error  '.native' modifier on 'v-on' directive is deprecated  vue/no-deprecated-v-on-native-modifier

Enter fullscreen mode Exit fullscreen mode

ref link: https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html

<template>
  <!-- ✓ GOOD -->
  <CoolInput v-on:keydown.enter="onKeydownEnter" />
  <CoolInput @keydown.enter="onKeydownEnter" />

  <!-- ✗ BAD -->
  <CoolInput v-on:keydown.native="onKeydown" />
  <CoolInput @keydown.enter.native="onKeydownEnter" />
</template>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)