yifeng1212

或许是比较新奇的 Modal 组件

  •  
  •   yifeng1212 · Sep 28, 2018 · 2321 views
    This topic created in 2813 days ago, the information mentioned may be changed or developed.

    平时用 modal 的场景挺多,而 UI 库的 modal 用得不太得心应手,于是自己动手写了一个,糅合了几个“新鲜”的想法。

    • 尽量不用写 HTML 代码

    比方说 ant-design 的 Modal.confirm,用起来就挺爽的。于是乎,要把这点发扬光大。直接支持 async/await。

    • 简单的场景一行代码搞定

    比方说,一个询问是否确认删除的弹框,这样就可以了!!

    const modal = Modal`你确定要删除吗?`
    
    • 可以插入 SFC
    • 可以插入 JSX

    在线例子:https://github.com/SME-FE/smv-modal
    文档地址:https://sme-fe.github.io/website-vmodal/zh/basic.html
    NPM: https://www.npmjs.com/package/smv-modal

    emmm 有点大杂烩的感觉,求 star 哈哈

    1 replies    2018-10-11 13:22:40 +08:00
    nezumi85757
        1
    nezumi85757  
       Oct 11, 2018
    不错,星一个!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3287 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 68ms · UTC 11:12 · PVG 19:12 · LAX 04:12 · JFK 07:12
    ♥ Do have faith in what you're doing.