使用DOMSubtreeModified事件检测dom变化

问题描述

有什么方法可以订阅DOMSubtreeModified事件吗?

module Subscriptions.Suscription exposing (subscriptions)

import Html.Events exposing (on)
import Json.Decode as Decode
import Models.MyModels exposing (MyModel)
import Update.Messages exposing (Msg(..))

subscriptions : MyModel -> Sub Msg
subscriptions model = 
    on "DOMSubtreeModified" (Decode.succeed (MyMSg model 0))

我收到以下错误

This `on` call produces:

    Html.Attribute Msg

But the type annotation on `subscriptions` says it should be:

    Sub Msg

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)