// 使用Icon的链接方式
Vue.component("link-icon", {
props: ["href", "title"],
data: function () {
return {
vTitle: (this.title == null) ? "打开链接" : this.title
}
},
template: ` `
})
// 带有下划虚线的连接
Vue.component("link-red", {
props: ["href", "title"],
data: function () {
let href = this.href
if (href == null) {
href = ""
}
return {
vHref: href
}
},
methods: {
clickPrevent: function () {
emitClick(this, arguments)
}
},
template: ``
})
// 会弹出窗口的链接
Vue.component("link-popup", {
props: ["title"],
methods: {
clickPrevent: function () {
emitClick(this, arguments)
}
},
template: ``
})
Vue.component("popup-icon", {
props: ["title", "href", "height"],
methods: {
clickPrevent: function () {
teaweb.popup(this.href, {
height: this.height
})
}
},
template: ` `
})
// 小提示
Vue.component("tip-icon", {
props: ["content"],
methods: {
showTip: function () {
teaweb.popupTip(this.content)
}
},
template: ``
})
// 提交点击事件
function emitClick(obj, arguments) {
let event = "click"
let newArgs = [event]
for (let i = 0; i < arguments.length; i++) {
newArgs.push(arguments[i])
}
obj.$emit.apply(obj, newArgs)
}