@cc-component/cc-ex-component 1.8.0 → 1.8.2

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.
@@ -323,9 +323,11 @@ export function ViewModel<T extends new (...args: any[]) => Component>(Base: T)
323
323
 
324
324
  resetButtonScale(btn: Button) {
325
325
  if (btn.transition === Button.Transition.SCALE && ExComponentModule.EmitAnim()) {
326
- btn.node.off(Node.EventType.TOUCH_START, btn[this.touch_start_scale]);
327
- btn.node.off(Node.EventType.TOUCH_END, btn[this.touch_end_scale]);
328
- btn.node.off(Node.EventType.TOUCH_CANCEL, btn[this.touch_end_scale]);
326
+ if (btn[this.touch_start_scale]) {
327
+ btn.node.off(Node.EventType.TOUCH_START, btn[this.touch_start_scale]);
328
+ btn.node.off(Node.EventType.TOUCH_END, btn[this.touch_end_scale]);
329
+ btn.node.off(Node.EventType.TOUCH_CANCEL, btn[this.touch_end_scale]);
330
+ }
329
331
  const scale = btn.zoomScale;
330
332
  btn[this.touch_start_scale] = () => {
331
333
  tween(btn.node).to(btn.duration, { scale: v3(scale, scale, scale) }).start()
@@ -12,6 +12,9 @@ const inject_vsearch = function (key, targetDataBinding) {
12
12
  let tag = property.tag || property.name;
13
13
 
14
14
  let instance = allNodeMap.get(tag);
15
+ if (instance == null) {
16
+ instance = allNodeMap.get(`$${tag}`);
17
+ }
15
18
  if (className.prototype.__classname__ != "cc.Node") {
16
19
  instance = instance?.getComponent(className) ?? instance?.addComponent(className);
17
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cc-component/cc-ex-component",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "engine": ">=3.8.6",
5
5
  "description": "系统组件添加常用扩展方法",
6
6
  "main": "index.ts",