我是 Mithrill v1.0.0 的新手,现在遇到了问题。在以前的版本中,我可以使用 m.prop()
作为 setter/getter 变量。在新版本中,它被Streams模块取代。
在 Mithrill 文档中说:
Streams are NOT bundled with Mithril's core distribution. To include the Streams module, use:
var Stream = require("mithril/stream")
我的问题是我不知道如何包含它。我通过 CDN 使用 mithrill。当我尝试直接使用 prop()
或 stream()
时,它给出了函数未定义的错误。
最佳答案
<script src="https://unpkg.com/mithril/stream/stream.js"></script>
它将以 window.stream
形式提供。
关于javascript - 通过 CDN 包含 Streams 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42106452/