我遵循了本教程https://www.oocademy.com/v13.0/tutorial/creating-and-using-javascript-assets-in-odoo-54
但是在调整屏幕大小时出现此错误:
在控制台中:TypeError: undefined is not an object (evaluating 'el.getBoundingClientRect')
这在odoo中
TypeError: undefined is not an object (evaluating 'el.getBoundingClientRect')
https://hesaby-hesaby-dev-l-1284261.dev.odoo.com/web/static/src/js/core/dom.js:554
Traceback:
computeFloatOuterWidthWithMargins@https://hesaby-hesaby-dev-l-1284261.dev.odoo.com/web/static/src/js/core/dom.js:554:26
_adapt@https://hesaby-hesaby-dev-l-1284261.dev.odoo.com/web/static/src/js/core/dom.js:543:68
later@https://hesaby-hesaby-dev-l-1284261.dev.odoo.com/web/static/lib/underscore/underscore.js:821:30
这是我的js代码
odoo.define("test.Dashboard", function (require) {
const AbstractAction = require("web.AbstractAction");
const core = require("web.core");
const OurAction = AbstractAction.extend({
start: function () {
this.$el.html("hello");
},
});
core.action_registry.add("test.action", OurAction);
});
能帮忙吗