콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
2725 화면

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

아바타
취소
관련 게시물 답글 화면 활동
0
7월 25
795
1
7월 25
5906
0
7월 25
1545
0
6월 25
1453
1
6월 25
1462