gpt4 book ai didi

javascript - Javascript 扩展和包含中的 Odoo 差异

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:01:06 25 4
gpt4 key购买 nike

在 Odoo 中,可以在一个类上extendinclude(在 Javascript 中)。 extendinclude 在 Odoo 中有什么区别?

最佳答案

当您扩展时,父类的实例保持不变,但新子类的实例将具有扩展功能。

OTOH,当您include 时,您是在将新功能添加到父类的原型(prototype)中,这意味着该类的所有实例都会自动包含扩展行为。


您知道,JS 使用原型(prototype);我写了classinstance 只是为了让它更容易理解。 😉

关于javascript - Javascript 扩展和包含中的 Odoo 差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49891397/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com