velocity is not a function materialize showing error in meteor

戏子无情 提交于 2019-12-08 15:15:12

问题


materialize.js:3503 Uncaught TypeError: $(...).find(...).css(...).velocity is not a function
(anonymous function) @ materialize.js:3503
jQuery.event.dispatch @ jquery.js:4665
elemData.handle @ jquery.js:4333

error in console shows up when I click on card (materailize)


回答1:


It's Becuase you may be including another version on jquery in you head tag. When you install materailize with meteor it also adds jquery as its dependency. Both versions are conflicting with each other. All you need to do is exclude that jquery script tag in your head tag.




回答2:


To solve this is used the jquery version that is located in the materialize folder

window.$ = window.jQuery = require('materialize-css/node_modules/jquery/dist/jquery.js');
require('materialize-css');



回答3:


The module materialize is incomplete.

I have created a solution for this problem, available on GitHub:

Create without webpack and velocity error : https://github.com/webpremium/angular2-materialize-cordova



来源:https://stackoverflow.com/questions/37478122/velocity-is-not-a-function-materialize-showing-error-in-meteor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!