Skip to content

Commit ea7d0f1

Browse files
committed
settings
1 parent d9208fb commit ea7d0f1

File tree

2 files changed

+41
-10
lines changed

2 files changed

+41
-10
lines changed

index.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
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>
1211
</head>
1312
<body>
1413
<div class="nav">
@@ -26,6 +25,13 @@
2625
</div>
2726
<div class="container" id="app">
2827
<div class="properties">
28+
<details>
29+
<summary>
30+
设定
31+
</summary>
32+
<input id="chn" type="checkbox" onclick="chnClick(this)" checked="true">启用中文</input>
33+
<input id="3d" type="checkbox" v-model="td">启用三维</input>
34+
</details>
2935
<details>
3036
<summary>
3137
数据
@@ -44,12 +50,20 @@
4450
参数
4551
</summary>
4652
<div>
47-
<table id="propcon">
53+
<!-- <table id="propcon"> -->
4854
<property chname="标题" propkey="title"></property>
4955
<tr>x轴</tr>
5056
<property chname="最小" propkey="xmin"></property>
5157
<property chname="最大" propkey="xmax"></property>
52-
</table>
58+
<tr>y轴</tr>
59+
<property chname="最小" propkey="ymin"></property>
60+
<property chname="最大" propkey="ymax"></property>
61+
<!-- </table> -->
62+
<div v-show="td">
63+
<tr>z轴</tr>
64+
<property chname="最小" propkey="zmin"></property>
65+
<property chname="最大" propkey="zmax"></property>
66+
</div>
5367
</div>
5468
</details>
5569
<button v-on="{click: compile}">编译</button><br>

web/js/main.js

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
// 参数字典
12
var paramDic = new Array();
23

4+
// 属性组件
35
Vue.component('property',{
4-
template:'<tr><td>{{chname}}</td><td>{{propkey}}</td><td><input :type="type" v-model="value" @keyup="on_change"></td></tr>',
6+
template:'<tr><td>{{chname}}</td><td>{{propkey}}</td><td><input type="text" v-model="value" @keyup="on_change"></td></tr>',
57
props: ['chname','propkey'],
68
data: function(){
79
return {
8-
type: "text", //属性的数据类型
10+
// type: "text", //属性的数据类型
911
value: "", //属性的值
1012
}
1113
},
@@ -22,17 +24,32 @@ Vue.component('property',{
2224
}
2325
});
2426

27+
var s_premable = "\\documentclass[tikz]{standalone}\n\
28+
\\usepackage{pgfplots}\n\
29+
\\usepackage{CJKutf8}\n\
30+
\\pgfplotsset{compat=1.14}\n\
31+
\\begin{document}\n";
32+
33+
var s_suffix = "\\end{document}";
34+
35+
chnClick = function(obj){
36+
if(obj.checked){
37+
app.premable = s_premable + "\\begin{CJK}{UTF8}{gbsn}\n";
38+
app.suffix = "\\end{CJK}\n" + s_suffix;
39+
} else {
40+
app.premable = s_premable;
41+
app.suffix = s_suffix;
42+
}
43+
};
2544

2645
var app = new Vue({
2746
el: '#app',
2847
data:{
48+
td: false,
2949
series: "",
3050
param: "",
31-
premable:"\\documentclass[tikz]{standalone}\n\
32-
\\usepackage{pgfplots}\n\
33-
\\pgfplotsset{compat=1.14}\n\
34-
\\begin{document}\n",
35-
suffix:"\\end{document}",
51+
premable: s_premable + "\\begin{CJK}{UTF8}{gbsn}\n",
52+
suffix: "\\end{CJK}\n" + s_suffix,
3653
curl:"",
3754
},
3855
computed:{

0 commit comments

Comments
 (0)