Demo:右下角支持跳转相关链接
This commit is contained in:
parent
f689d333f9
commit
f20748744a
@ -72,9 +72,16 @@
|
|||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<a href="https://github.com/wanglin2/mind-map" target="_blank">
|
<el-dropdown @command="handleCommand">
|
||||||
<span class="iconfont icongithub"></span>
|
<div class="btn iconfont iconbangzhu"></div>
|
||||||
</a>
|
<el-dropdown-menu slot="dropdown">
|
||||||
|
<el-dropdown-item command="github">Github</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="helpDoc">使用文档</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="devDoc">开发文档</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="site">官方网站</el-dropdown-item>
|
||||||
|
<el-dropdown-item command="issue">意见反馈</el-dropdown-item>
|
||||||
|
</el-dropdown-menu>
|
||||||
|
</el-dropdown>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -116,7 +123,7 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
...mapState(['isDark'])
|
...mapState(['isDark'])
|
||||||
},
|
},
|
||||||
created () {
|
created() {
|
||||||
this.lang = getLang()
|
this.lang = getLang()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -143,6 +150,33 @@ export default {
|
|||||||
|
|
||||||
toggleDark() {
|
toggleDark() {
|
||||||
this.setIsDark(!this.isDark)
|
this.setIsDark(!this.isDark)
|
||||||
|
},
|
||||||
|
|
||||||
|
handleCommand(command) {
|
||||||
|
let url = ''
|
||||||
|
switch (command) {
|
||||||
|
case 'github':
|
||||||
|
url = 'https://github.com/wanglin2/mind-map'
|
||||||
|
break
|
||||||
|
case 'helpDoc':
|
||||||
|
url = 'https://wanglin2.github.io/mind-map/#/help/zh/'
|
||||||
|
break
|
||||||
|
case 'devDoc':
|
||||||
|
url = 'https://wanglin2.github.io/mind-map/#/doc/zh/introduction/'
|
||||||
|
break
|
||||||
|
case 'site':
|
||||||
|
url = 'https://wanglin2.github.io/mind-map/#/index'
|
||||||
|
break
|
||||||
|
case 'issue':
|
||||||
|
url = 'https://github.com/wanglin2/mind-map/issues/new'
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
const a = document.createElement('a')
|
||||||
|
a.href = url
|
||||||
|
a.target = '_blank'
|
||||||
|
a.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user