vue v-href跳转外部链接功能实现
export default {
href: {
bind(el, binding, vnode) {
el.style.cursor = 'pointer'
if (!(binding.value || '').trim()) return
const url = binding.value
el.addEventListener('click', () => {
window.open(url, '_blank')
})
}
}
}