Coder Social home page Coder Social logo

[Bug Report] toast about vant-weapp HOT 9 OPEN

1393254712 avatar 1393254712 commented on June 14, 2024
[Bug Report] toast

from vant-weapp.

Comments (9)

johnsonwong666 avatar johnsonwong666 commented on June 14, 2024

Toast({message: '无更多数据'});
这里加个setTimeout包一下 delay 0

from vant-weapp.

1393254712 avatar 1393254712 commented on June 14, 2024

Toast({message: '无更多数据'}); 这里加个setTimeout包一下 delay 0

0还是会闪现消失

from vant-weapp.

johnsonwong666 avatar johnsonwong666 commented on June 14, 2024

可以简单提供一个代码片段吗?

from vant-weapp.

johnsonwong666 avatar johnsonwong666 commented on June 14, 2024

https://developers.weixin.qq.com/s/FMLMEgmJ7CQJ

在这上面改一下 然后分享回来

from vant-weapp.

1393254712 avatar 1393254712 commented on June 14, 2024

可以简单提供一个代码片段吗?

classHomeworkApi.getClassHomeworkList(account.id, params , res => { Toast.clear(); if (res.status == ResultCodeConstant.SUCCESS_CODE) { } else { Toast({message: res.message}); } }, err => { Toast.clear(); Toast({message: err.message}); });

from vant-weapp.

johnsonwong666 avatar johnsonwong666 commented on June 14, 2024

什么原因需要加一个Toast.clear()呢? 感觉这个是不是多余了

from vant-weapp.

1393254712 avatar 1393254712 commented on June 14, 2024

什么原因需要加一个Toast.clear()呢? 感觉这个是不是多余了

因为我有的地方只需要清除toast 不需要显示别的提示
不然就只能在不显示toast的地方单独clear一下 才能避免问题

from vant-weapp.

johnsonwong666 avatar johnsonwong666 commented on June 14, 2024

这里先clear 紧接着Toast别的内容,这里代码应该存在一点问题。按照你的情况的话 在catch里面 直接Toast别的内容就可以了

from vant-weapp.

1393254712 avatar 1393254712 commented on June 14, 2024

这里先clear 紧接着Toast别的内容,这里代码应该存在一点问题。按照你的情况的话 在catch里面 直接Toast别的内容就可以了

是的 这个确实没必要加 我在res里面有几个if 有一个需要Toast一下, 所以在进入res里面就直接clear了 我如果快速请求两次 触发了两次clear 就会导致后面的toast给清除了

from vant-weapp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.