Merge branch 'develop'

Former-commit-id: 65d4e617324cfc4277ebd7e47a07a9af3c15a76c
This commit is contained in:
liyang
2019-01-16 20:14:40 +08:00
3 changed files with 13 additions and 6 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "d2-admin",
"version": "1.6.12",
"version": "1.6.13",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
@@ -1,5 +1,6 @@
<template>
<div
v-if="show"
class="d2-source"
:class="{ 'd2-source--active': isActive }"
@click="handleClick">
@@ -21,6 +22,13 @@ export default {
isActive: false
}
},
computed: {
show () {
return process.env.VUE_APP_BUILD_MODE === 'TRAVIS' ||
process.env.NODE_ENV === 'development' &&
this.filename
}
},
mounted () {
// 一秒后显示按钮
setTimeout(() => {
@@ -32,8 +40,8 @@ export default {
handleClick () {
const file = this.filename.split('?')[0]
const url = file
? `https://github.com/d2-projects/d2-admin-start-kit/blob/master/${file}`
: 'https://github.com/d2-projects/d2-admin-start-kit'
? `https://github.com/d2-projects/d2-admin/blob/master/${file}`
: 'https://github.com/d2-projects/d2-admin'
this.$open(url)
}
}
+2 -3
View File
@@ -54,10 +54,9 @@ export default {
scroll: e => this.$emit('scroll', e)
}
}, slots),
// 只在预览和开发模式下显示源码按钮
process.env.VUE_APP_BUILD_MODE === 'TRAVIS' || process.env.NODE_ENV === 'development' ? h(d2Source, {
h(d2Source, {
props: this.$attrs
}) : undefined
})
])
},
methods: {