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

低版本浏览器模板无法运行 js方法 #1596

Closed
4 tasks done
wlf2r opened this issue Jan 26, 2024 · 3 comments
Closed
4 tasks done

低版本浏览器模板无法运行 js方法 #1596

wlf2r opened this issue Jan 26, 2024 · 3 comments
Labels
unrelated 与 Layui 无关的问题

Comments

@wlf2r
Copy link

wlf2r commented Jan 26, 2024

议题条件

  • 我确认已查看官方使用文档:https://layui.dev ,但没有找到相关解决方案。
  • 我确认已在 Issues 中搜索过类似的问题,但没有找到相关解决方案。
  • 我已仔细阅读: 🍀 Layui Issue 贡献指南

议题类型

疑是 BUG

使用版本

2.96

问题描述

目前测试 搜狗浏览器8.6.0.30561版本的 模板无法运行js方法
image

业务代码

{{# var rs = _cDom.showDom(d.data[index]) }} 与
{{- _cDom.showDom(d.data[index]) }}

运行报
ypeError: template[o].replaceAll is not a function

截图补充

No response

浏览器

搜狗浏览器8.6.0.30561

演示地址

No response

友好承诺

  • 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 Layui 良好的社区氛围。
@Sight-wcg
Copy link
Collaborator

Sight-wcg commented Jan 26, 2024

replaceAll 是 ES2021 添加的,低版本浏览器不支持。建议使用 replace 或者添加 replaceAll 的 Polyfill。

@Sight-wcg Sight-wcg added the unrelated 与 Layui 无关的问题 label Jan 26, 2024
Copy link

@wlf2r 你提出的问题与 Layui 可能不存在相关联。建议通过以下方式寻求解决方案:

  • 通过其他技术社区搜索相关资料、或充分利用当前主流的人工智能大模型
  • Discussions

详见:🍀 Layui Issue 贡献指南

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
@wlf2r
Copy link
Author

wlf2r commented Jan 26, 2024

整个layui.js 搜索去掉replaceAll 还是报此错,_cDom.sowDom 此方法只是返回字符串

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unrelated 与 Layui 无关的问题
Projects
None yet
Development

No branches or pull requests

2 participants