我正在使用 VueJs 构建一个 Web 应用程序,并且需要一个 css 框架来设计一些东西,而不是从头开始!
我找到了material-design-lite(www.getmdl.io),但我无法让它与vue-router一起正常工作。
我的第一页正确显示,但当我尝试移动到另一个页面时,出现此错误:
vue.esm.js?65d7:467 DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
我认为这是因为文档中的“在动态网站上使用 MDL”(https://getmdl.io/started/index.html https://getmdl.io/started/index.html)但我无法弄清楚并解决我的问题。
否则,我找不到 vue 的示例来解决这个问题。
有人知道如何让 mdl 与 vuejs 一起使用吗?
谢谢,
朱尔斯.
有些元素是在 MDL 的 componentHandler 运行后由 Vue 插入的,所以你必须restart他们。您可以在已安装的挂钩中执行此操作:
mounted: function(){
componentHandler.upgradeAllRegistered();
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)