Former-commit-id: 4a7766ff077e800f547090b24610ad50040156d6
master
wangbing 4 years ago
parent 54ee1fb0b9
commit cc228d40eb

@ -23,19 +23,21 @@ html, body, #app {
padding: 10px;
}
.search input {
.search .search-key {
padding: 5px;
height: 30px;
outline: none;
width: 100%;
border: 1px dashed #cacaca;
}
.search p {
font-size: 12px;
.search p{
text-align: center;
color: #757575;
padding: 5px;
transform: scale(0.8);
}
.search p input{
font-size: 20px;
padding: 5px;
text-align: center;
}

@ -21,9 +21,16 @@
</div>
<div class="search">
<input v-model="searchKey" placeholder="搜索关键字...">
<input class="search-key" v-model="searchKey" placeholder="搜索关键字...">
<p>提示WEB接口(H)API接口(A)</p>
<p>
<input class="search-type" type="checkbox" id="ajax" name="type" v-model="ajax"
checked>
<label for="ajax">AJAX</label>
<input class="search-type" type="checkbox" id="api" name="type" v-model="api"
checked>
<label for="api">API</label>
</p>
</div>
<div class="body">
@ -54,6 +61,7 @@
</tr>
</table>
</div>
<h5>响应参数</h5>
<div class="wrapper">
@ -77,6 +85,18 @@
</table>
</div>
<h5>调试实例</h5>
<div class="wrapper" v-if="select.type == 'ajax'">
<pre>new Ajax("{{select.module}}", "{{select.target}}", "{{select.method}}").post({}, function (response) {</pre>
<pre> if (response.errors.length > 0) {</pre>
<pre> nav.e(response.errors[0].message);</pre>
<pre> } else {</pre>
<pre> nav.i("Ajax调用成功!");</pre>
<pre> }</pre>
<pre>}.bind(this))</pre>
</div>
<h5 id="User">附录参数(<span class="object">User</span>)</h5>
<div class="wrapper">

@ -2,6 +2,8 @@ var app = new Vue({
el: "#app",
data: {
searchKey: '',
ajax: true,
api: true,
select: {},
data: [
<#list docList as item>
@ -53,13 +55,12 @@ var app = new Vue({
},
computed: {
list: function () {
var reg = new RegExp(this.searchKey, 'ig');
if (this.searchKey) {
return this.data.filter(function (item) {
return item.title.match(reg);
});
}
return this.data;
return this.data.filter(function (item) {
var f1 = this.searchKey ? item.title.match(new RegExp(this.searchKey, "ig")) : true;
var f2 = this.ajax && item.type == "ajax";
var f3 = this.api && item.type == "api";
return f1 && (f2 || f3);
}.bind(this));
}
},
methods: {

Loading…
Cancel
Save

Powered by TurnKey Linux.