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

[NoticeBar] bind:click没有获取当前的content #2566

Closed
Nathanielna opened this issue Jan 20, 2024 · 2 comments
Closed

[NoticeBar] bind:click没有获取当前的content #2566

Nathanielna opened this issue Jan 20, 2024 · 2 comments
Labels
question This is a question, not a bug

Comments

@Nathanielna
Copy link

Nathanielna commented Jan 20, 2024

tdesign-miniprogram 版本

1.2.3

重现链接

<t-notice-bar visible="{{true}}" direction="vertical" interval="{{3000}}" suffixIcon="chevron-right" content="{{marketlisttitle}}" prefixIcon="sound" bind:click="clicknotice" t-class="external-class" t-class-prefix-icon="external-class-prefix-icon" ></t-notice-bar>

clicknotice(e){ console.log(e) },

重现步骤

No response

期望结果

获取我点击时的content

实际结果

image

基础库版本

No response

补充说明

No response

Copy link
Contributor

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

@betavs
Copy link
Collaborator

betavs commented Jan 22, 2024

<t-notice-bar
  visible="{{true}}"
  direction="vertical"
  interval="{{3000}}"
  suffixIcon="chevron-right"
  content="{{marketlisttitle}}"
  data-content="{{marketlisttitle}}"
  prefixIcon="sound"
  bind:click="clicknotice"
  t-class="external-class"
  t-class-prefix-icon="external-class-prefix-icon"
/>
clicknotice(e) {
  const { content } = e.currentTarget.dataset;
  console.log(content);
},

通过 dataset 来获取即可

@betavs betavs added the question This is a question, not a bug label Jan 22, 2024
@anlyyao anlyyao closed this as completed Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This is a question, not a bug
Projects
None yet
Development

No branches or pull requests

3 participants