laravel

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

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

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