// 加载图片
export default {
	name: 'loadimg',
	mounted(el, binding) {
		const src = binding.value
		if (el.src === src) return
		const img = new Image()
		img.src = src
		img.onload = () => {
			el.src = src
		}
		img.onerror = () => {
			console.log('图片加载失败:', src)
		}
	},
};