Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
Former-commit-id: 16ec15a14e588607c87f0d01dc6cb56a717f7d0e
  • Loading branch information
FairyEver committed Jan 16, 2019
2 parents 9a71121 + b4cae94 commit 96c0137
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d2-admin",
"version": "1.6.12",
"version": "1.6.13",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --open",
Expand Down
8 changes: 8 additions & 0 deletions src/components/d2-container/components/d2-source.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div
v-if="show"
class="d2-source"
:class="{ 'd2-source--active': isActive }"
@click="handleClick">
Expand All @@ -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(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/components/d2-container/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 96c0137

Please sign in to comment.