Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2738 มุมมอง

As question, I tried to use "useState" hook shown in the search_bar.js provided in the source code. But it gives me this error: 


web.assets_backend.min.js:14814 Uncaught SyntaxError: Cannot use import statement outside a module
web.assets_common.min.js:29 warning: Some modules could not be started
web.assets_common.min.js:29 Missing dependencies: Array(26)
web.assets_common.min.js:34 Non loaded modules: Array(58)


Part of the source code: 

import { useState } from"@odoo/owl";
odoo.define("myModel.TreeModel", function (require) {

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

To use import you need to put /** @odoo-module */ at the begging of JS file

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

Please follow this blog.

https://www.cybrosys.com/blog/hooks-in-odoo-owl-framework


Hope it helps

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.ค. 25
803
1
ก.ค. 25
5923
0
ก.ค. 25
1571
0
มิ.ย. 25
1503
1
มิ.ย. 25
1466