File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed
packages/demo/src/index/views/Demo Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 186186 handleCancel () {
187187 console .log (' Cancel' );
188188 },
189+ clipboard (value ) {
190+ if (document .execCommand ) {
191+ const input = document .createElement (' input' );
192+ document .body .appendChild (input);
193+ input .setAttribute (' value' , value);
194+ input .select ();
195+
196+ document .execCommand (' copy' );
197+ document .body .removeChild (input);
198+
199+ return true ;
200+ }
201+
202+ this .$message .info (value);
203+ return false ;
204+ },
189205 handleSubmit () {
190206 console .log (' Submit' );
207+ if (this .$route .query .type === ' Test' ) {
208+ const genRoute = this .$router .resolve ({
209+ query: {
210+ type: ' Test' ,
211+ schema: this .curSchemaCode ,
212+ formData: this .curFormDataCode ,
213+ uiSchema: this .curUiSchemaCode ,
214+ errSchema: this .curErrorSchemaCode ,
215+ }
216+ });
217+ const url = ` ${ window .location .origin }${ window .location .pathname }${ genRoute .href } ` ;
218+
219+ if (this .clipboard (url)) {
220+ this .$message .success (' 复制预览地址成功' );
221+ }
222+ }
191223 }
192224 }
193225 };
Original file line number Diff line number Diff line change 1+ /**
2+ * Created by Liu.Jun on 2020/7/22 11:07 下午.
3+ */
4+
5+ export default {
6+ schema : {
7+ title : '测试专用页' ,
8+ type : 'object' ,
9+ description : '请输入你的Schema' ,
10+ properties : {
11+ }
12+ }
13+ } ;
You can’t perform that action at this time.
0 commit comments