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 3434 <el-col :span =" 0" >  ; </el-col >
3535 </el-form-item >
3636 </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 >
3745 </div >
3846</template >
3947
@@ -60,6 +68,37 @@ export default {
6068 },
6169 created () {},
6270 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+ },
63102 onSubmit (form ) {
64103 this .$refs [form].validate ((valid ) => {
65104 if (valid) {
You can’t perform that action at this time.
0 commit comments