arisu.js 2.0.1-beta.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -53
- package/dist/types/js/main.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
## 项目名称
|
|
2
|
-
常用JS
|
|
2
|
+
常用JS方法工具合集,版本:2.0.1
|
|
3
3
|
|
|
4
4
|
### 简介
|
|
5
5
|
包含了基础工具类,以及一些普通网站管理平台上可能需要的组件,按钮状态设置、返回顶部、局部loading、数据增删改查列表等等..,API文档访问:https://www.arisu.cn/springmvc/api/0
|
|
@@ -112,7 +112,6 @@
|
|
|
112
112
|
b('body').loading();
|
|
113
113
|
b("body").loading("complete");
|
|
114
114
|
|
|
115
|
-
|
|
116
115
|
// 2. 静态方法
|
|
117
116
|
// 2.1 基础静态方法
|
|
118
117
|
// 参数继承覆盖
|
|
@@ -174,7 +173,6 @@
|
|
|
174
173
|
// 包含搜索按钮删除按钮的搜索框
|
|
175
174
|
b.search(function(txt) { if (txt) console.log(txt); });// 输入框文本
|
|
176
175
|
|
|
177
|
-
|
|
178
176
|
// 3. 其他常用方法、原生JS方法重写等
|
|
179
177
|
// 时间格式化
|
|
180
178
|
new Date().format("yyyy-MM-dd hh:mm:ss")//'2024-06-10 10:47:06'
|
|
@@ -185,74 +183,71 @@
|
|
|
185
183
|
```
|
|
186
184
|
二、常用JS插件组件
|
|
187
185
|
```bash
|
|
188
|
-
|
|
189
|
-
import b,
|
|
190
|
-
|
|
191
|
-
or
|
|
192
|
-
import b, { SubmitFlag } from 'ilib/utils'
|
|
193
|
-
let sf = new SubmitFlag(".e2")
|
|
186
|
+
//utils.ts使用范例
|
|
187
|
+
import b, { SubmitFlag } from 'arisu.js'
|
|
188
|
+
const sf = new SubmitFlag(".e2")
|
|
194
189
|
|
|
195
|
-
1. SubmitFlag防用户多次点击:new
|
|
196
|
-
2. 底部按钮快速移动到顶部:new
|
|
197
|
-
3. 数字增加减少,购物数量控制:new
|
|
198
|
-
4. niceSelect自定义下拉框:new
|
|
199
|
-
5. 按钮动画:new
|
|
200
|
-
6. 局部loading动画:new
|
|
201
|
-
7. 分页:new
|
|
202
|
-
8. 列表查询分页封装插件:const ilist = new
|
|
203
|
-
9. 手风琴导航菜单:new
|
|
204
|
-
10. 弹框搜索面板:new
|
|
205
|
-
11. 文字切换动画特效:new
|
|
206
|
-
12. 绘制点线背景动画:new
|
|
207
|
-
13. JS、CSS页面引入,多次引入只保留一个:const iloader = new
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
```bash
|
|
211
|
-
//使用范例
|
|
212
|
-
import { b, u, m } from 'ilib/main'
|
|
213
|
-
|
|
190
|
+
1. SubmitFlag防用户多次点击:new SubmitFlag(".e2")
|
|
191
|
+
2. 底部按钮快速移动到顶部:new GoTop({
|
|
192
|
+
3. 数字增加减少,购物数量控制:new ItemCount({
|
|
193
|
+
4. niceSelect自定义下拉框:new NiceSelect('#ns2')
|
|
194
|
+
5. 按钮动画:new BtnEf(".bn-btn-5")
|
|
195
|
+
6. 局部loading动画:new AeLoader()...
|
|
196
|
+
7. 分页:new IPagination({ target: '#ipagination'...
|
|
197
|
+
8. 列表查询分页封装插件:const ilist = new IList({ target: '#test-list' ..
|
|
198
|
+
9. 手风琴导航菜单:new IAccordion({ speed: 300, showCount: true });
|
|
199
|
+
10. 弹框搜索面板:new PopoverSearch('#ipopover', {
|
|
200
|
+
11. 文字切换动画特效:new Flash("#ce-flash", {
|
|
201
|
+
12. 绘制点线背景动画:new LineEffect("#canvas-warp", {
|
|
202
|
+
13. JS、CSS页面引入,多次引入只保留一个:const iloader = new ILoader();
|
|
203
|
+
|
|
204
|
+
//main.ts使用范例
|
|
214
205
|
1. Main类,用户常用登录登出token设置获取等操作
|
|
206
|
+
包含:getUser,getToken,setToken,login,logout方法
|
|
215
207
|
2. handlebars模板判断表达式支持,不依赖其他框架:b.handlebars(Handlebars);
|
|
216
208
|
3. bootstrap 文本提示框,依赖bootstrap
|
|
217
209
|
<a href="#" class="me-1 js-detail"><i class="bi bi-search"></i></a>
|
|
218
210
|
import { Tooltip } from 'glib/bootstrap';
|
|
219
211
|
b.tip(Tooltip);
|
|
220
|
-
4.
|
|
221
|
-
5.
|
|
222
|
-
<div id="carousel-image" class="owl-carousel owl-theme">
|
|
223
|
-
<div class="item thumbnail"><img src="//arisu.cn/file/images/res/anime/anime1470402086147.jpg"></img></div>
|
|
224
|
-
<div class="item thumbnail">....
|
|
225
|
-
b.owl($("#carousel-image"), {});
|
|
226
|
-
6. 消息弹框,依赖jQuery:b.al("你好,世界", 'success');
|
|
227
|
-
7. 确定框,依赖jQuery:
|
|
212
|
+
4. 消息弹框,依赖jQuery:b.al("你好,世界", 'success');
|
|
213
|
+
5. 确定框,依赖jQuery:
|
|
228
214
|
b.cf("是否确定删除该记录!", "删除", () => {
|
|
229
215
|
b.al("删除成功!", "success");
|
|
230
216
|
}, 2, "ice");
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
11. air-datepicker时间控件,不依赖其他框架
|
|
235
|
-
12. niceScroll滚动条,依赖jQuery
|
|
236
|
-
13. validationEngine表单验证,依赖jQuery
|
|
237
|
-
14. validate确认是否验证通过
|
|
217
|
+
6. air-datepicker时间控件,不依赖其他框架:b.datepicker(AirDatepicker, localeZh)
|
|
218
|
+
7. validationEngine表单验证,依赖jQuery:b.validationEngine($("#form-1, #form-2"));
|
|
219
|
+
8. validate确认是否验证通过:const isSuccessed = b.validate($("#form-2"));
|
|
238
220
|
```
|
|
221
|
+
三、实际开发常用方法及模块插件扩展或初始化
|
|
239
222
|
### 安装
|
|
240
223
|
```bash
|
|
241
224
|
npm i arisu.js
|
|
225
|
+
import b, { SubmitFlag } from 'arisu.js'
|
|
226
|
+
|
|
242
227
|
or
|
|
243
|
-
<script src="/arisu.
|
|
228
|
+
<script src="/arisu.umd.js"></script>
|
|
244
229
|
```
|
|
245
230
|
#### 使用:
|
|
246
231
|
npm安装使用:
|
|
247
232
|
```bash
|
|
248
|
-
import b,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
233
|
+
import b, {
|
|
234
|
+
SubmitFlag,
|
|
235
|
+
GoTop,
|
|
236
|
+
ItemCount,
|
|
237
|
+
NiceSelect,
|
|
238
|
+
BtnEf,
|
|
239
|
+
AeLoader,
|
|
240
|
+
IPagination,
|
|
241
|
+
IList,
|
|
242
|
+
IAccordion,
|
|
243
|
+
PopoverSearch,
|
|
244
|
+
Flash,
|
|
245
|
+
LineEffect,
|
|
246
|
+
HoverDir,
|
|
247
|
+
ILoader,
|
|
248
|
+
} from 'arisu.js';
|
|
249
|
+
// b基础类,其他常用工具类,调用如:
|
|
254
250
|
let sf = new SubmitFlag("#id")
|
|
255
|
-
|
|
256
251
|
b(#btn").click((e) => {
|
|
257
252
|
// sf.request();
|
|
258
253
|
// 或者
|
|
@@ -266,12 +261,15 @@
|
|
|
266
261
|
|
|
267
262
|
// ilist类演示
|
|
268
263
|
import 'istyle/dist/arisu.css'
|
|
269
|
-
import
|
|
264
|
+
import b, { IList } from 'arisu.js'
|
|
270
265
|
import '../css/bootstrap-icons.css'
|
|
271
266
|
import Handlebars from 'glib/handlebars'
|
|
272
267
|
import { Tooltip } from 'glib/bootstrap';
|
|
268
|
+
// or
|
|
269
|
+
//import * as bootstrap from 'glib/bootstrap';
|
|
270
|
+
//const tooltipInstance = new bootstrap.Tooltip(elementRef.current, options);
|
|
273
271
|
|
|
274
|
-
const ilist = new
|
|
272
|
+
const ilist = new IList('#test-list', {
|
|
275
273
|
url: "./springmvc/news/findNews.action",
|
|
276
274
|
param: {},
|
|
277
275
|
method: "get",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/js/main.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/js/main.ts"],"names":[],"mappings":"AAAA,OAAU,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;wBAkdb,GAAG;AAAvB,wBAAwB;AACxB,OAAO,EAAE,IAAI,EAAE,CAAC"}
|