3 回答

TA貢獻(xiàn)1845條經(jīng)驗(yàn) 獲得超8個(gè)贊
原來它是不是可能的逃跑與一個(gè)JavaScript iOS的Web應(yīng)用程序window.open()
。如果您想在移動(dòng)瀏覽器中打開鏈接,則必須使用<a href>
鏈接。

TA貢獻(xiàn)1797條經(jīng)驗(yàn) 獲得超6個(gè)贊
Vue實(shí)施。希望會(huì)有所幫助。
<template>
<div @click='handler()'>{{ text }}</div>
</template>
<script>
export default {
props: {
href: String,
text: String,
},
methods: {
handler() {
const a = document.createElement('a')
a.setAttribute('href', this.href)
a.dispatchEvent(new MouseEvent("click", {'view': window, 'bubbles': true, 'cancelable': true}))
}
}
}
</script>
添加回答
舉報(bào)