Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2881 Lượt xem

Hi,

I want to patch memoized const exported function of js file (like luxonToMomentFormat in @web/core/l10n/dates).

How can i do that?
Note: i tried the usual patch and did not work.

Ảnh đại diện
Huỷ bỏ

Can you please share the patching code you tried?

Câu trả lời hay nhất

Hi,

You could try the below mentioned method to patch js.
/** @odoo-module **/

import { patch } from "@web/core/utils/patch";
import { luxonToMomentFormat } from "@web/core/l10n/dates";

patch(luxonToMomentFormat, 'module_name.luxonToMomentFormat', {
    start() {
        return this._super();
    }
});

Hope it helps

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 24
2720
0
thg 4 23
1690
0
thg 3 15
2906
2
thg 7 24
2880
1
thg 11 24
4897