Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dialog] 命令方式调用组件,透传confirmBtn的openType存在问题 #3177

Closed
Nero978 opened this issue Oct 7, 2024 · 1 comment · Fixed by #3178
Closed

[Dialog] 命令方式调用组件,透传confirmBtn的openType存在问题 #3177

Nero978 opened this issue Oct 7, 2024 · 1 comment · Fixed by #3178

Comments

@Nero978
Copy link
Contributor

Nero978 commented Oct 7, 2024

tdesign-miniprogram 版本

1.6.1

重现链接

No response

重现步骤

<t-dialog id="t-dialog" />

import Dialog from 'tdesign-miniprogram/dialog/index';

  feedback() {
    const dialogConfig = {
      context: this,
      usingCustomNavbar: true,
      title: '提建议',
      content: '前往反馈中心,快速反馈你的意见。',
      cancelBtn: '取消',
      confirmBtn: {
        content: '确认',
        openType: 'feedback',
      },
    };
    Dialog.confirm(dialogConfig)
      .then(() => {
        console.log('点击确认');
      })
      .catch(() => {
        console.log('点击取消');
      });
  },

navigate() {
    const dialogConfig = {
      context: this,
      usingCustomNavbar: true,
      title: `xxxxx`,
      content: 'xxxxxx',
      cancelBtn: '取消',
      confirmBtn: '确认',
    };
    Dialog.confirm(dialogConfig)
      .then(() => {
        wx.navigateTo({
          url: '/pages/bind/bind',
        });
      })
      .catch(() => {
        console.log('点击取消');
      });
  },

先调用 feedback(),用户点击确认/取消后,再调用 navigate()confirmBtn中的open-type没有重置,依然为feedbck
image

期望结果

dialog关闭后btnopen-type需要重置,或者每次关闭后都销毁

实际结果

当前结果将导致先打开feedback页面,然后立即跳转对应pathpage,与预期结果不符

基础库版本

No response

补充说明

No response

Copy link
Contributor

github-actions bot commented Oct 7, 2024

👋 @Nero978,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant