// 单个注册使用
// Vue.directive('imgerror', {
// inserted(el, binding) {
// // el指令所在的元素节点
// // console.log(el, "指令节点");
// // console.log(binding, "绑定的相关信息");
// el.onerror = function() {
// // 出错情况下图片路径就换成指令的value
// el.src = binding.value
// }
// },
// });
main.js引入
// 导入自定义指令
// import "@/directives"
import * as directives from "@/directives" //所有的对象全部导入