Skip to content

Commit 8629d70

Browse files
committed
Add tips
1 parent 9dcb753 commit 8629d70

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/components/Main.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
<div class="form-group mb-4 text-left">
88
<label for="TargetFuncName">Target function name</label>
9+
<a href="#" class="ml-2" @click="toggleTargetFuncTip">How to get?</a>
910
<input
1011
type="text"
1112
class="form-control"
@@ -14,6 +15,9 @@
1415
v-model="targetName"
1516
/>
1617
</div>
18+
19+
<TargetFuncTip ref="TargetFuncTip"></TargetFuncTip>
20+
1721
<div class="form-group mb-4 text-left">
1822
<label for="codeInputTextarea">Input</label>
1923
<textarea
@@ -50,6 +54,7 @@
5054
id="codeResultTextarea"
5155
rows="5"
5256
v-model="outputCode"
57+
@click="copyToClipboard"
5358
></textarea>
5459
</div>
5560
</div>
@@ -58,10 +63,12 @@
5863
<script>
5964
import Analizer from "@/Analizer.js";
6065
import Alert from "@/components/Alert.vue";
66+
import TargetFuncTip from "@/components/TargetFuncTip.vue";
6167
6268
export default {
6369
components: {
6470
Alert,
71+
TargetFuncTip,
6572
},
6673
6774
data() {
@@ -129,6 +136,14 @@ export default {
129136
}
130137
document.getElementById("running-progress-bar").style.width = rate + "%";
131138
},
139+
copyToClipboard() {
140+
const copyTarget = document.getElementById("codeResultTextarea");
141+
copyTarget.select();
142+
document.execCommand("Copy");
143+
},
144+
toggleTargetFuncTip() {
145+
this.$refs.TargetFuncTip.toggle();
146+
}
132147
},
133148
134149
mounted() {

src/sass/main.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,15 @@
1010

1111
#running-progress-bar {
1212
width: 0%;
13+
}
14+
15+
.codeblock {
16+
padding: 10px 20px;
17+
background-color: rgba(194, 200, 206, .2);
18+
margin: 20px;
19+
}
20+
21+
span.target {
22+
color: rgb(148, 33, 142);
23+
font-weight: bold;
1324
}

0 commit comments

Comments
 (0)