使用 $options.__file 实现更简单的源码查看功能
Former-commit-id: 4c6a0a1f72e1f512b919b934d8483ed430b54766 [formerly f1a4641c19751caddc88308bd8e29fb337f88982] [formerly 4c6a0a1f72e1f512b919b934d8483ed430b54766 [formerly f1a4641c19751caddc88308bd8e29fb337f88982] [formerly 4c6a0a1f72e1f512b919b934d8483ed430b54766 [formerly f1a4641c19751caddc88308bd8e29fb337f88982] [formerly f1a4641c19751caddc88308bd8e29fb337f88982 [formerly 065fde485c713b3ae79131d9da1234dfcbc73cc4 [formerly 470fef55bcb2073a14b6fcc998caabcb83a1097c]]]]] Former-commit-id: c239db922bd8bd06fb68041118a2d25a9c7b475d Former-commit-id: ac5808e62e6ac021da35462b59a04004d62db2dc Former-commit-id: 7890270a60f4db69526403a56cb2dd4feb662e27 [formerly 7b8dd27f1eb72f5e3748d8174fa69c801a73ce1a] Former-commit-id: 027ba79fa86ad1be42f14ef03afebde0cc6ed924 Former-commit-id: 0425a72d2e2b3536fb2ac74199ede23a1e4bea96 Former-commit-id: 96bdce03185ba3befec93d08016d63c7c3c2030a Former-commit-id: e988828be9b03917a9579651a2912d2ed840fb7d Former-commit-id: 07646c36ed91ea4e1efac1bdf1b16b84d8d32eaa
This commit is contained in:
@@ -10,13 +10,6 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
// 文件路径
|
||||
filename: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
isActive: false
|
||||
@@ -24,7 +17,7 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
show () {
|
||||
return (process.env.VUE_APP_BUILD_MODE === 'TRAVIS' || process.env.NODE_ENV === 'development') && this.filename
|
||||
return process.env.VUE_APP_BUILD_MODE === 'TRAVIS' || process.env.NODE_ENV === 'development'
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
@@ -36,11 +29,7 @@ export default {
|
||||
methods: {
|
||||
// 点击按钮的时候跳转到源代码
|
||||
handleClick () {
|
||||
const file = this.filename.split('?')[0]
|
||||
const url = file
|
||||
? `https://github.com/d2-projects/d2-admin/blob/master/${file}`
|
||||
: 'https://github.com/d2-projects/d2-admin'
|
||||
this.$open(url)
|
||||
this.$open(`https://github.com/d2-projects/d2-admin/blob/master/${this.$parent.$parent.$options.__file}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,9 +52,7 @@ export default {
|
||||
scroll: e => this.$emit('scroll', e)
|
||||
}
|
||||
}, slots),
|
||||
h(d2Source, {
|
||||
props: this.$attrs
|
||||
})
|
||||
h(d2Source)
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
|
||||
Reference in New Issue
Block a user