我正在尝试使用 Odoo OWL 库,并且遵循文档中的解释。
import { Component } from "@odoo/owl";
import { useService } from "@web/core/utils/hooks";
export class ReviewUnderName extends Component {
static template = "devolive_review.ReviewUnderName";
static props = {};
setup() {
this.rpc = useService("rpc");
this.loadData();
}
async loadData() {
const response = await this.rpc(`/devolive/review/`);
console.log("response", response);
}
不幸的是,我收到错误:Service rpc is not available
rpc
服务与Odoo OWL Components 一起使用?