there is an error defining the global directive v-color in Vue. The error content is: [Vue warn]: Failed to resolve directive: color
(found in < Anonymous >)
I don"t know what"s going on.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.6/dist/vue.js"></script>
<body>
<div id="app">
<h2 v-color>{{msg}}</h2>
</div>
<script>
var vm=new Vue({
el:"-sharpapp",
data:{
msg:"3333ff"
},
})
Vue.directive("color",{
bind:function(el) {
el.style.color="red"
}
})
</script>
</body>
</html>
v-color made a mistake. Please take a look at it. Thank you ~