File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 34
34
<el-col :span =" 0" >  ; </el-col >
35
35
</el-form-item >
36
36
</el-form >
37
+ <el-row >
38
+ <el-col :span =" 4" >  ;  ; </el-col >
39
+ <el-col :span =" 4" >
40
+ <el-button @click =" copyInput" >一键复制输入内容</el-button >
41
+ </el-col >
42
+ <el-col :span =" 7" >  ;  ; </el-col >
43
+ <el-col :span =" 1" ><el-button @click =" copyOutput" >一键复制输出内容</el-button ></el-col >
44
+ </el-row >
37
45
</div >
38
46
</template >
39
47
@@ -60,6 +68,37 @@ export default {
60
68
},
61
69
created () {},
62
70
methods: {
71
+ copyInput () {
72
+ const that = this
73
+ that .$copyText (this .form .input ).then (function (e ) {
74
+ that .$message ({
75
+ message: ' 输入内容复制成功' ,
76
+ type: ' success'
77
+ })
78
+ }, function (e ) {
79
+ this .$message ({
80
+ message: ' 复制失败' ,
81
+ type: ' error'
82
+ })
83
+ console .log (e)
84
+ })
85
+ },
86
+ copyOutput () {
87
+ const that = this
88
+ this .$copyText (this .output ).then (function (e ) {
89
+ that .$message ({
90
+ message: ' 输出内容复制成功' ,
91
+ type: ' success'
92
+ })
93
+ // console.log(e)
94
+ }, function (e ) {
95
+ this .$message ({
96
+ message: ' 复制失败' ,
97
+ type: ' error'
98
+ })
99
+ console .log (e)
100
+ })
101
+ },
63
102
onSubmit (form ) {
64
103
this .$refs [form].validate ((valid ) => {
65
104
if (valid) {
You can’t perform that action at this time.
0 commit comments