我正在将模板从 odoo 8 迁移到 Odoo 10 并使用“owl.carousel”和其他 JS,但它们都不起作用。
我想知道JS API是否改变了?如果是这样,JS中的绝对新手如何学习如何修复脚本..
这是我得到的日志控制台:
unreachable code after return statement web.assets_backend.js:3538:266
/* /web_kanban/static/src/js/compatibility.js defined in bundle 'web.assets_backend' */
odoo.define('web_kanban.compatibility',function(require){"use strict";var kanban_widgets=require('web_kanban.widgets');var KanbanRecord=require('web_kanban.Record');var KanbanColumn=require('web_kanban.Column');var KanbanView=require('web_kanban.KanbanView');return;openerp=window.openerp||{};openerp.web_kanban=openerp.web_kanban||{};openerp.web_kanban.AbstractField=kanban_widgets.AbstractField;openerp.web_kanban.KanbanGroup=KanbanColumn;openerp.web_kanban.KanbanRecord=KanbanRecord;openerp.web_kanban.KanbanView=KanbanView;});;
aucun élément trouvé qweb:1:1
TypeError: $(...).owlCarousel is not a function web.assets_frontend.js:41:30
/* <inline asset> defined in bundle 'web.assets_frontend' */
$(document).ready(function(){$('.owl-carousel').owlCarousel({loop:true,margin:10,nav:true,autoPlay:1000,responsive:{0:{items:1},600:{items:3},1000:{items:5}}})});
这是我包含在我的 odoo 模块中的测试代码:
<xpath expr="//script[last()]" position="after">
<!-- JS -->
<script src="/my_theme/static/src/js/fancybox/jquery.fancybox.pack.js"></script>
<script src="/my_theme/static/src/js/jquery.easing.1.3.js"></script>
<script src="/my_theme/static/src/js/jquery.bxslider.min.js"></script>
<script type="text/javascript" src="/my_theme/static/src/js/owl.carousel.min.js"></script>
<script type="text/javascript" src="/my_theme/static/src/js/mousescroll.js"></script>
<script type="text/javascript" src="/my_theme/static/src/js/smoothscroll.js"></script>
<script type="text/javascript" src="/my_theme/static/src/js/jquery.prettyPhoto.js"></script>
<script type="text/javascript" src="/my_theme/static/src/js/jquery.isotope.min.js"></script>
<script type="text/javascript" src="/my_theme/static/src/js/jquery.inview.min.js"></script>
<script type="text/javascript" src="/my_theme/static/src/js/wow.min.js"></script>
</xpath>