mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 22:08:25 +08:00
Demo:备注里的超链接改为新窗口打开
This commit is contained in:
@@ -71,10 +71,19 @@ export default {
|
||||
onShowNoteContent(content, left, top, node) {
|
||||
this.node = node
|
||||
this.editor.setMarkdown(content)
|
||||
this.handleALink()
|
||||
this.updateNoteContentPosition(left, top)
|
||||
this.show = true
|
||||
},
|
||||
|
||||
// 超链接新窗口打开
|
||||
handleALink() {
|
||||
const list = this.$refs.noteContentViewer.querySelectorAll('a')
|
||||
Array.from(list).forEach(a => {
|
||||
a.setAttribute('target', '_blank')
|
||||
})
|
||||
},
|
||||
|
||||
// 更新位置
|
||||
updateNoteContentPosition(left, top) {
|
||||
this.left = left
|
||||
|
||||
Reference in New Issue
Block a user