跳至內容
選單
此問題已被標幟
2 回覆
2666 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
7月 25
559
1
7月 25
5576
0
7月 25
1169
0
6月 25
1105
1
6月 25
1227