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>
The reason is that there is no custom directive registered. For more usage of custom directives, please see here.
๐คsugars
- [Vuejs]-Place part of the navbar brand outside the bar
- [Vuejs]-How to pass "this" as well as v-model from input to handler
Source:stackexchange.com