Skip to content

Commit 590e372

Browse files
committed
feat[github]: add a github link
1 parent 10a09af commit 590e372

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed
Lines changed: 1 addition & 0 deletions
Loading

src/views/FormEditor/FormCode/index.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
{{drawer.show?'隐藏':'显示'}}代码
2525
</span>
2626
</el-button>
27+
<el-button v-if="drawer.control.key==='github'" size="mini">
28+
<a href="https://github.com/Liugq5713/vue-element-form-editor" target="_blank">
29+
<img :src="github" width="13px" alt srcset>
30+
</a>
31+
</el-button>
2732
</template>
2833
<code class="code">
2934
<div style="overflow:auto">
@@ -48,6 +53,7 @@
4853
/* eslint-disable no-useless-escape */
4954
import { genVueFileWrapper } from "./vueSnippet.js";
5055
import Drawer from "@/components/Drawer";
56+
import github from "./github.svg";
5157
5258
export default {
5359
components: {
@@ -66,6 +72,7 @@ export default {
6672
},
6773
data() {
6874
return {
75+
github,
6976
srcCode: "",
7077
fromItemsCode: "",
7178
refCode: "",
@@ -84,6 +91,11 @@ export default {
8491
key: "look",
8592
show: "查看",
8693
hidden: "隐藏"
94+
},
95+
{
96+
key: "github",
97+
show: "查看",
98+
hidden: "隐藏"
8799
}
88100
]
89101
};
@@ -125,7 +137,7 @@ export default {
125137
openDrawer(target) {
126138
let shouldOpen = true;
127139
while (!target.matches(".controls")) {
128-
if (target.matches(".control-0")) {
140+
if (target.matches(".control-0") || target.matches(".control-2")) {
129141
shouldOpen = false;
130142
break;
131143
} else {
@@ -165,5 +177,6 @@ export default {
165177
.code-container >>> .control {
166178
padding: 0;
167179
border: 0;
180+
background-color: #fff0;
168181
}
169182
</style>

0 commit comments

Comments
 (0)