V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
qcloud
V2EX  ›  问与答

toastr 的 toastr.options 自定义设置应该写在哪里?

  •  
  •   qcloud · 2016-11-20 21:50:45 +08:00 · 1553 次点击
    这是一个创建于 2775 天前的主题,其中的信息可能已经有所发展或是发生改变。

    http://codeseven.github.io/toastr/demo.html

    需要一些自定义的样式,但是不知道在哪里调用这个设置,是调用一个文件吗?还是直接在源代码中写?

    3 条回复    2016-11-21 16:53:08 +08:00
    stiekel
        1
    stiekel  
       2016-11-21 07:01:18 +08:00   ❤️ 1
    先在项目里引用 toastr 的主文件,然后调接使用 toastr.option 就行了。
    qcloud
        2
    qcloud  
    OP
       2016-11-21 10:41:47 +08:00
    @stiekel 然后调接使用 toastr.option 就行了,这个 toastr.option 是需要写在每个 toastr 后面吗?
    stiekel
        3
    stiekel  
       2016-11-21 16:53:08 +08:00   ❤️ 1
    @qcloud 不用,全局有效。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1322 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:47 · PVG 01:47 · LAX 10:47 · JFK 13:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.