File tree Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Expand file tree Collapse file tree 2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change 88 < link rel ="stylesheet " href ="web/css/main.css ">
99 < script src ="https://polyfill.io/v3/polyfill.min.js?features=es6 "> </ script >
1010 < script id ="MathJax-script " async src ="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js "> </ script >
11+ < script src ="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js "> </ script >
1112</ head >
1213< body >
1314 < div class ="nav ">
4344 参数
4445 </ summary >
4546 < div >
46- < table >
47+ < table id =" propcon " >
4748 < property chname ="标题 " propkey ="title "> </ property >
49+ < tr > x轴</ tr >
50+ < property chname ="最小 " propkey ="xmin "> </ property >
51+ < property chname ="最大 " propkey ="xmax "> </ property >
4852 </ table >
4953 </ div >
5054 </ details >
Original file line number Diff line number Diff line change 1+ var paramDic = new Array ( ) ;
2+
13Vue . component ( 'property' , {
24 template :'<tr><td>{{chname}}</td><td>{{propkey}}</td><td><input :type="type" v-model="value" @keyup="on_change"></td></tr>' ,
35 props : [ 'chname' , 'propkey' ] ,
46 data : function ( ) {
57 return {
68 type : "text" , //属性的数据类型
7- value : "" , //属性的值
8- }
9- } ,
10- computed :{
11- paramString : function ( ) {
12- return this . propkey + "={" + this . value + "}," ;
9+ value : "" , //属性的值
1310 }
1411 } ,
1512 methods :{
1613 on_change : function ( ) {
17- if ( this . value != "" )
18- app . param = this . paramString ;
19- else
20- app . param = "" ;
14+ paramDic [ this . propkey ] = this . value ;
15+
16+ app . param = "" ;
17+ for ( var key in paramDic )
18+ if ( paramDic [ key ] != "" )
19+ app . param += key + "={" + paramDic [ key ] + "}," ;
20+
2121 }
2222 }
2323} ) ;
2424
25+
2526var app = new Vue ( {
2627 el : '#app' ,
2728 data :{
@@ -30,15 +31,13 @@ var app = new Vue({
3031 premable :"\\documentclass[tikz]{standalone}\n\
3132\\usepackage{pgfplots}\n\
3233\\pgfplotsset{compat=1.14}\n\
33- \\begin{document}\n\
34- \\begin{tikzpicture}" ,
35- suffix :"\\end{tikzpicture}\n\
36- \\end{document}" ,
34+ \\begin{document}\n" ,
35+ suffix :"\\end{document}" ,
3736 curl :"" ,
3837 } ,
3938 computed :{
4039 content : function ( ) {
41- return "\\begin{axis}[" + this . param + "]\n " + this . series + "\n\\end{axis}" ;
40+ return "\\begin{tikzpicture}\n\\begin{ axis}[" + this . param + "]\n " + this . series + "\n\\end{axis}\n\\end{tikzpicture }" ;
4241 } ,
4342 file : function ( ) {
4443 return this . premable + this . content + this . suffix ;
You can’t perform that action at this time.
0 commit comments