[Vue警告]:无法解析指令:wave(在<I18n>中的src / views / backend / areachange / Index.vue中找到)

时间:2019-10-22 14:53:37

标签: javascript vue.js element-ui

enter image description here

我正在使用https://element.eleme.io/#/ 我在每个列表页中都面临着

1 个答案:

答案 0 :(得分:1)

Vue.directive('custom', {
  inserted: function(el) {
    el.style.backgroundColor = 'orange'
  }
})

var app = new Vue({
  el: '#app'
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
  <input v-custom type="text">
  <input v-waves type="text">
  <!-- The `v-waves` directive will have the same error -->
</div>

原因是没有注册自定义指令。有关自定义指令的更多用法,请please see here