完善 SourceCode
Former-commit-id: 178f8509b7aca79b0c7bf4e36a54e14c466813dc [formerly 178f8509b7aca79b0c7bf4e36a54e14c466813dc [formerly 178f8509b7aca79b0c7bf4e36a54e14c466813dc [formerly 178f8509b7aca79b0c7bf4e36a54e14c466813dc [formerly 6a4e78b1141e0b28cb1f123454915beaa04b34a4 [formerly 481c93d328485031a939f96ec72150897902f0c1]]]]] Former-commit-id: b51e506942b1328bb045d516b218d70d6ce99b7d Former-commit-id: edf669e53fb1b611b9ba2575f426decc71cbc7f9 Former-commit-id: ba6c0641d73df6de0e71ab867a382aa3633500e9 [formerly d5bff56112625461a64952f11cb2a212a0ce4327] Former-commit-id: 6403f70864033aa261745b9528505ce3598335f7 Former-commit-id: b8c62ad0f37cb4188e91699d5efd0a58e5cefd8b Former-commit-id: a51513084098497931e35db64057c88793254f5a Former-commit-id: 5c546900deb043ae5b333f0cca1ce6b966c13a75 Former-commit-id: 497a03106487a227c21ca9444898d77ce8e7a3a1
This commit is contained in:
parent
6805fcce04
commit
779579c49b
3
.env
3
.env
|
|
@ -5,3 +5,6 @@ VUE_APP_TITLE=D2Admin
|
|||
|
||||
# 网络请求公用地址
|
||||
VUE_APP_API=/api/
|
||||
|
||||
# 仓库地址
|
||||
VUE_APP_REPO=https://github.com/d2-projects/d2-admin
|
||||
|
|
|
|||
|
|
@ -9,15 +9,25 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { last, get } from 'lodash'
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
isActive: false
|
||||
isActive: false,
|
||||
path: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
show () {
|
||||
return process.env.VUE_APP_BUILD_MODE === 'TRAVIS'
|
||||
return process.env.VUE_APP_BUILD_MODE === 'TRAVIS' || process.env.NODE_ENV === 'development'
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler (to) {
|
||||
this.path = get(last(to.matched), 'components.default.__file')
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
|
|
@ -29,7 +39,7 @@ export default {
|
|||
methods: {
|
||||
// 点击按钮的时候跳转到源代码
|
||||
handleClick () {
|
||||
this.$open(`https://github.com/d2-projects/d2-admin/blob/master/${this.$parent.$parent.$options.__file}`)
|
||||
this.$open(`${process.env.VUE_APP_REPO}/blob/master/${this.path}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ module.exports = {
|
|||
config => config.devtool('cheap-source-map')
|
||||
)
|
||||
// TRAVIS 构建 vue-loader 添加 filename
|
||||
.when(process.env.VUE_APP_BUILD_MODE === 'TRAVIS',
|
||||
.when(process.env.VUE_APP_BUILD_MODE === 'TRAVIS' || process.env.NODE_ENV === 'development',
|
||||
config => config.module
|
||||
.rule('vue')
|
||||
.use('vue-loader')
|
||||
|
|
|
|||
Loading…
Reference in New Issue