Demo:备注里的超链接改为新窗口打开
This commit is contained in:
parent
322f7a3e2a
commit
4c5b2e7af2
@ -71,10 +71,19 @@ export default {
|
|||||||
onShowNoteContent(content, left, top, node) {
|
onShowNoteContent(content, left, top, node) {
|
||||||
this.node = node
|
this.node = node
|
||||||
this.editor.setMarkdown(content)
|
this.editor.setMarkdown(content)
|
||||||
|
this.handleALink()
|
||||||
this.updateNoteContentPosition(left, top)
|
this.updateNoteContentPosition(left, top)
|
||||||
this.show = true
|
this.show = true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 超链接新窗口打开
|
||||||
|
handleALink() {
|
||||||
|
const list = this.$refs.noteContentViewer.querySelectorAll('a')
|
||||||
|
Array.from(list).forEach(a => {
|
||||||
|
a.setAttribute('target', '_blank')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 更新位置
|
// 更新位置
|
||||||
updateNoteContentPosition(left, top) {
|
updateNoteContentPosition(left, top) {
|
||||||
this.left = left
|
this.left = left
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user