【问题标题】:Stimulus Reflex Lifecycle events刺激反射生命周期事件
【发布时间】:2020-11-01 10:38:57
【问题描述】:

这个要点是一个使用刺激反射的应用程序。这是关于分页反射的,我需要隐藏的是当afterReflex()回调执行时的微调器,但有时它不起作用。

https://gist.github.com/matedemorphy/94c6ad13b6aebd89862b5b14120c98df

我在 config/initializers/session_store.rb 中有这一行

Rails.application.config.session_store :cookie_store, key: _my_app, domain: lvh.me,但后来在 development.rb 中

config.session_store :cache_store config.cache_store = :file_store, Rails.root.join(tmp, cache).to_s, { size: 320.megabytes }

那里可能有冲突?

【问题讨论】:

标签: ruby-on-rails devise apartment-gem stimulusjs stimulus-reflex


【解决方案1】:

在官方文档中:如果您有多个相同的元素调用 Reflex 操作,则不会运行生命周期机制(afterReflex 回调、成功事件等)。所以我解决了添加data-id

【讨论】:

    猜你喜欢
    • 2021-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多