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

[link] 动态生成的链接数组对象在初始化时候 报黄色警告 #3020

Closed
Qing1 opened this issue Jul 29, 2024 · 6 comments
Closed
Labels
question This is a question, not a bug

Comments

@Qing1
Copy link

Qing1 commented Jul 29, 2024

tdesign-miniprogram 版本

1.5.0

重现链接

https://github.com/Qing1/TDesignUIminiLearningTest/tree/main

重现步骤

在表格中动态生成链接时候 有黄色警告
image

期望结果

去除该黄色警告

实际结果

No response

基础库版本

3.5.1

补充说明

No response

Copy link
Contributor

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

@anlyyao
Copy link
Collaborator

anlyyao commented Jul 30, 2024

@Qing1 提供的重现链接地址不存在。

告警原因已经被你圈出来了😅。大概率是在初始化阶段,你传入的navigatorProps是一个非对象,提示让你用null代替。

@anlyyao anlyyao added the question This is a question, not a bug label Jul 30, 2024
@Qing1
Copy link
Author

Qing1 commented Jul 30, 2024

Hello 美女大佬 不好意思 之前仓库是私人状态 。开始时候 我也觉得是因为我传的对象不对 因为data中 linkOederList:[], 是这样的 后来 我修改成 linkOrderList1:{},还是没有解决问题 初始化时候 在onLoad{this.link1()}中 在对应的页面 < t-link navigator-props="{{linkOrderList1[item.employeeId]}}",还是没有解决这个问题

@betavs
Copy link
Collaborator

betavs commented Jul 30, 2024

@Qing1 可以等数据处理完再显示即可

<t-link
  wx:if="{{ visible }}"
  size="small"
  theme="primary"
  content="详情"
  navigator-props="{{ linkOrderList[index] }}"
  prefixIcon="link"
  t-class="linkStyle"
  hover
  bindcomplete="onNav"
  data-id="{{ item.employeeId }}"
/>
this.setData(
  {
    linkOrderList: linkList,
  },
  () => {
    this.setData({ visible: true });
  }
);

@Qing1
Copy link
Author

Qing1 commented Jul 30, 2024

谢谢大佬 非常效率。这个修改后 确实可以去除那个黄色警告。就想知道有没有更优雅的方法【不用前端来考虑这个问题】 来实现这个效果……哈哈,有点贪心

@betavs
Copy link
Collaborator

betavs commented Jul 30, 2024

@Qing1

<t-link
  wx:if="{{ linkOrderList[index] }}"
  size="small"
  theme="primary"
  content="详情"
  navigator-props="{{ linkOrderList[index] }}"
  prefixIcon="link"
  t-class="linkStyle"
  hover
  bindcomplete="onNav"
  data-id="{{ item.employeeId }}"
/>

@betavs betavs closed this as completed Aug 9, 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