ht-components-taro-v3 1.0.4 → 1.0.5

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 ADDED
@@ -0,0 +1,20 @@
1
+
2
+ # HTScrollView
3
+
4
+ ## 参数
5
+
6
+ | 参数 | 类型 | 含义 | 必填 | 默认值 |
7
+ | :------: | :-------: | :-------: | :------: | :------: |
8
+ | ajaxFn | function | 请求函数 | 是 | - |
9
+ | api | string | 请求接口 - h5环境下使用 | 是 | - |
10
+ | method | string | 请求方法,默认GET | 是 | 'GET' |
11
+ | resListKey | string | 返回数据列表的key | 是 | - |
12
+ | renderItemFn | function | 列表项渲染函数,函数参数为item和index | 是 | - |
13
+ | className | string | 组件的自定义类名 | - | - |
14
+ | isShowNoMoreDataTips | boolean | 是否显示没有更多数据的提示,默认显示 | - | true |
15
+ | noMoreDataTipsText | string | 没有更多数据的提示内容 | - | '没有更多数据了' |
16
+ | ajaxData | object | 额外的请求参数 | - | {} |
17
+ | limit | number | 每次请求的数据条数,默认10 | - | 10 |
18
+ | dealReqDataFn | function | 请求回来的数据处理函数 | - | - |
19
+ | onReqErrorFn | function | 请求失败回调函数 | - | - |
20
+
package/dist/cjs/index.js CHANGED
@@ -2415,9 +2415,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2415
2415
 
2416
2416
  // className 组件的自定义类名
2417
2417
  // isShowNoMoreDataTips 是否显示没有更多数据的提示,默认显示
2418
+ // noMoreDataTipsText 没有更多提示的内容
2418
2419
  // ajaxFn 请求函数
2419
- // api 请求接口 - h5环境下使用
2420
- // method 请求方法,默认GET - h5环境下使用
2420
+ // api 请求接口
2421
+ // method 请求方法,默认GET
2421
2422
  // ajaxData = {} 额外的请求参数
2422
2423
  // limit 每次请求的数据条数,默认10
2423
2424
  // resListKey 返回数据列表的key
@@ -2427,7 +2428,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2427
2428
  var HTScrollView = function HTScrollView(props) {
2428
2429
  var className = props.className,
2429
2430
  _props$isShowNoMoreDa = props.isShowNoMoreDataTips,
2430
- isShowNoMoreDataTips = _props$isShowNoMoreDa === void 0 ? true : _props$isShowNoMoreDa;
2431
+ isShowNoMoreDataTips = _props$isShowNoMoreDa === void 0 ? true : _props$isShowNoMoreDa,
2432
+ _props$noMoreDataTips = props.noMoreDataTipsText,
2433
+ noMoreDataTipsText = _props$noMoreDataTips === void 0 ? "没有更多数据了" : _props$noMoreDataTips;
2431
2434
 
2432
2435
  // 是否正在请求
2433
2436
  var _useState = React.useState(true),
@@ -2500,7 +2503,7 @@ var HTScrollView = function HTScrollView(props) {
2500
2503
  onAjaxError();
2501
2504
  });
2502
2505
  } else if (env === "weapp") {
2503
- ajaxFn(ajaxParams).then(function (res) {
2506
+ ajaxFn(method, api, ajaxParams).then(function (res) {
2504
2507
  dealAjaxData(res);
2505
2508
  }).catch(function (err) {
2506
2509
  onAjaxError(err);
@@ -2547,7 +2550,7 @@ var HTScrollView = function HTScrollView(props) {
2547
2550
  src: "https://xiaobangkj.oss-cn-hangzhou.aliyuncs.com/mini-live/taroComponentsV3/scroll-bottom-loading-icon.png"
2548
2551
  }), "\u6B63\u5728\u52A0\u8F7D\u4E2D..."), isCompleteAllData && !!isShowNoMoreDataTips && /*#__PURE__*/React__default["default"].createElement(components.View, {
2549
2552
  className: "no-more-data-tip"
2550
- }, "\u6CA1\u6709\u66F4\u591A\u6570\u636E\u4E86"));
2553
+ }, noMoreDataTipsText));
2551
2554
  };
2552
2555
 
2553
2556
  exports.HTScrollView = HTScrollView;
package/dist/esm/index.js CHANGED
@@ -2406,9 +2406,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2406
2406
 
2407
2407
  // className 组件的自定义类名
2408
2408
  // isShowNoMoreDataTips 是否显示没有更多数据的提示,默认显示
2409
+ // noMoreDataTipsText 没有更多提示的内容
2409
2410
  // ajaxFn 请求函数
2410
- // api 请求接口 - h5环境下使用
2411
- // method 请求方法,默认GET - h5环境下使用
2411
+ // api 请求接口
2412
+ // method 请求方法,默认GET
2412
2413
  // ajaxData = {} 额外的请求参数
2413
2414
  // limit 每次请求的数据条数,默认10
2414
2415
  // resListKey 返回数据列表的key
@@ -2418,7 +2419,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
2418
2419
  var HTScrollView = function HTScrollView(props) {
2419
2420
  var className = props.className,
2420
2421
  _props$isShowNoMoreDa = props.isShowNoMoreDataTips,
2421
- isShowNoMoreDataTips = _props$isShowNoMoreDa === void 0 ? true : _props$isShowNoMoreDa;
2422
+ isShowNoMoreDataTips = _props$isShowNoMoreDa === void 0 ? true : _props$isShowNoMoreDa,
2423
+ _props$noMoreDataTips = props.noMoreDataTipsText,
2424
+ noMoreDataTipsText = _props$noMoreDataTips === void 0 ? "没有更多数据了" : _props$noMoreDataTips;
2422
2425
 
2423
2426
  // 是否正在请求
2424
2427
  var _useState = useState(true),
@@ -2491,7 +2494,7 @@ var HTScrollView = function HTScrollView(props) {
2491
2494
  onAjaxError();
2492
2495
  });
2493
2496
  } else if (env === "weapp") {
2494
- ajaxFn(ajaxParams).then(function (res) {
2497
+ ajaxFn(method, api, ajaxParams).then(function (res) {
2495
2498
  dealAjaxData(res);
2496
2499
  }).catch(function (err) {
2497
2500
  onAjaxError(err);
@@ -2538,7 +2541,7 @@ var HTScrollView = function HTScrollView(props) {
2538
2541
  src: "https://xiaobangkj.oss-cn-hangzhou.aliyuncs.com/mini-live/taroComponentsV3/scroll-bottom-loading-icon.png"
2539
2542
  }), "\u6B63\u5728\u52A0\u8F7D\u4E2D..."), isCompleteAllData && !!isShowNoMoreDataTips && /*#__PURE__*/React.createElement(View, {
2540
2543
  className: "no-more-data-tip"
2541
- }, "\u6CA1\u6709\u66F4\u591A\u6570\u636E\u4E86"));
2544
+ }, noMoreDataTipsText));
2542
2545
  };
2543
2546
 
2544
2547
  export { HTScrollView };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ht-components-taro-v3",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "基于 Rollup 构建的 Taro 多端组件库",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",