使用VueJS的材料设计

时间:2017-04-17 09:22:50

标签: javascript vue.js material-design material-design-lite vue-router

我正在使用VueJ构建一个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),但我无法弄清楚并解决我的问题。

否则,我无法通过vue找到解决此问题的示例。

有人知道如何让mdl与vuejs一起工作吗?

谢谢, 朱。

1 个答案:

答案 0 :(得分:0)

在MDL的componentHandler运行后,Vue会插入一些元素,因此您必须重新启动它们。你可以在挂钩中执行此操作:

mounted: function(){
    componentHandler.upgradeAllRegistered();
}
相关问题