ok-admin/pages/help/okUtils.html

83 lines
2.1 KiB
HTML
Raw Normal View History

2019-10-27 15:10:20 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>okUtils</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
2019-10-27 15:19:38 +00:00
<link rel="stylesheet" href="../../css/oksub.css">
2019-10-27 15:10:20 +00:00
<style>
.ok-body {
padding: 20px;
}
</style>
</head>
<body>
<div class="ok-body">
<blockquote class="layui-elem-quote">
<p>主要讲述如何okUtils封装的工具类使用方法。</p>
</blockquote>
<!--1、okUtils.ajax-->
<blockquote class="layui-elem-quote layui-quote-nm">
okUtils.ajax(url, type, params, load);
</blockquote>
<pre>
okUtils.ajax("/permission/tree", "get", null, true).done(function (response) {
console.log(response);
}).fail(function (error) {
console.log(error);
});
</pre>
<table class="layui-table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead>
<tr>
<th>参数</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>url</td>
<td>String</td>
<td>请求路径</td>
</tr>
<tr>
<td>type</td>
<td>String</td>
<td>请求类型</td>
</tr>
<tr>
<td>params</td>
<td>String</td>
<td>请求参数</td>
</tr>
<tr>
<td>load</td>
<td>Boolean</td>
<td>是否显示loading</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
<script src="../../lib/layui/layui.js"></script>
<script type="text/javascript">
layui.use(["util", "code"], function () {
let util = layui.util;
let code = layui.code;
util.fixbar({});
code({
elem: 'pre',
title: "代码示例"
});
});
</script>