From 5036880fc037e5d112206b93a729f60be12bf8ab Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 07 十一月 2024 17:03:13 +0800 Subject: [PATCH] 2024.11.07 bug修复 --- miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js index 7b28044..e3f5ac8 100644 --- a/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js +++ b/miniprogram_npm/tdesign-miniprogram/dropdown-menu/dropdown-menu.js @@ -7,6 +7,7 @@ import { SuperComponent, wxComponent } from '../common/src/index'; import config from '../common/config'; import props from './props'; +import { calcIcon } from '../common/utils'; const { prefix } = config; const name = `${prefix}-dropdown-menu`; let DropdownMenu = class DropdownMenu extends SuperComponent { @@ -21,6 +22,7 @@ menus: null, activeIdx: -1, bottom: 0, + _arrowIcon: { name: props.arrowIcon.value }, }; this.relations = { '../dropdown-item/dropdown-item': { @@ -30,6 +32,16 @@ this.lifetimes = { ready() { this.getAllItems(); + }, + }; + this.observers = { + arrowIcon(v) { + this.setData({ + _arrowIcon: calcIcon(v), + }); + }, + activeIdx(v) { + this.triggerEvent(v === -1 ? 'close' : 'open'); }, }; this.methods = { @@ -81,6 +93,7 @@ const { index } = e.currentTarget.dataset; this.toggle(index); }, + noop() { }, }; } }; -- Gitblit v1.9.3