我正在尝试使用 CableReady,我在文档中注意到我可以使用相关的 JavaScript 事件。
但是,没有关于如何使用它们的示例。
例子:
cable_ready["MyChannel"].morph(
selector: "string", # required - string containing a CSS selector or XPath expression
html: "string", # [null] - the HTML to assign
children_only: true|false, # [null] - indicates if only child nodes should be morphed... skipping the parent element
permanent_attribute_name: "string", # [null] - an attribute name that prevents elements from being updated i.e. "data-permanent"
focus_selector: "string", # [null] - string containing a CSS selector
)
文档有:
JavaScript Events
cable-ready:before-morph
cable-ready:after-morph
但是我不知道如何在我的 Javascript 中调用这些事件。
以前有人用过这些吗?