@tuya-miniapp/smart-ui 2.8.1-beta-3 → 2.8.1-beta-4

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.
@@ -3,6 +3,7 @@ import { SmartComponent } from '../common/component';
3
3
  import { useChildren } from '../common/relation';
4
4
  import { getRect, isDef } from '../common/utils';
5
5
  import { pageScrollMixin } from '../mixins/page-scroll';
6
+ import ty from '../common/ty';
6
7
  const indexList = () => {
7
8
  const indexList = [];
8
9
  const charCodeOfA = 'A'.charCodeAt(0);
@@ -51,6 +52,13 @@ SmartComponent({
51
52
  activeAnchorIndex: null,
52
53
  showSidebar: false,
53
54
  },
55
+ watch: {
56
+ activeAnchorIndex(newVal) {
57
+ if (newVal !== null && newVal !== -1) {
58
+ ty.vibrateShort({ type: 'light' });
59
+ }
60
+ },
61
+ },
54
62
  created() {
55
63
  this.scrollTop = 0;
56
64
  },
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  var color_1 = require("../common/color");
4
7
  var component_1 = require("../common/component");
5
8
  var relation_1 = require("../common/relation");
6
9
  var utils_1 = require("../common/utils");
7
10
  var page_scroll_1 = require("../mixins/page-scroll");
11
+ var ty_1 = __importDefault(require("../common/ty"));
8
12
  var indexList = function () {
9
13
  var indexList = [];
10
14
  var charCodeOfA = 'A'.charCodeAt(0);
@@ -53,6 +57,13 @@ var indexList = function () {
53
57
  activeAnchorIndex: null,
54
58
  showSidebar: false,
55
59
  },
60
+ watch: {
61
+ activeAnchorIndex: function (newVal) {
62
+ if (newVal !== null && newVal !== -1) {
63
+ ty_1.default.vibrateShort({ type: 'light' });
64
+ }
65
+ },
66
+ },
56
67
  created: function () {
57
68
  this.scrollTop = 0;
58
69
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuya-miniapp/smart-ui",
3
- "version": "2.8.1-beta-3",
3
+ "version": "2.8.1-beta-4",
4
4
  "author": "MiniApp Team",
5
5
  "license": "MIT",
6
6
  "miniprogram": "lib",