laravel

vue cli 3 创建的新项目可以直接用 async await 吗?兼容性如何?

  •  
  •   laravel · Aug 5, 2019 · 4370 views
    This topic created in 2482 days ago, the information mentioned may be changed or developed.
    6 replies    2019-09-28 01:57:37 +08:00
    waiaan
        1
    waiaan  
       Aug 5, 2019
    可以,上 babel。
    ochatokori
        2
    ochatokori  
       Aug 5, 2019 via Android
    完全可以,cli2 都自带 babel 了
    现代浏览器甚至不需要 babel
    SilentDepth
        3
    SilentDepth  
       Aug 5, 2019
    第一个问题:可以。

    第二个问题:见 https://caniuse.com/#feat=async-functions。
    SilentDepth
        4
    SilentDepth  
       Aug 5, 2019
    上面链接错了,修正: https://caniuse.com/#feat=async-functions
    laravel
        5
    laravel  
    OP
       Aug 8, 2019
    还是 async、await 好用,微信上传图片的场景,好像不让并发调用接口,所以只能把 promise 串行执行,以前用 reduce
    现在只需要 await 就行了。
    lucky1990
        6
    lucky1990  
       Sep 28, 2019
    当然可以
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2491 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 69ms · UTC 00:51 · PVG 08:51 · LAX 17:51 · JFK 20:51
    ♥ Do have faith in what you're doing.