mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: fix order of lookup in t-component directive
Previously, the order of resolution was: - components defined on the class of the current component - components defined on the QWeb instance - the current instance's context This is unnatural because it doesn't go from most specific to least, as the current instance's context is the most specific. This is also fragile, as adding components to the QWeb instance can break unrelated components. This commit fixes that by making the lookup start with the current component's context instead
This commit is contained in:
committed by
Géry Debongnie
parent
7dfa901332
commit
e646eb697e
@@ -24,7 +24,7 @@ exports[`animations t-transition combined with component 1`] = `
|
||||
c1.push(pvnode);
|
||||
} else {
|
||||
let componentKey2 = \`Child\`;
|
||||
let W2 = context.constructor.components[componentKey2] || QWeb.components[componentKey2]|| scope['Child'];
|
||||
let W2 = scope['Child'] || context.constructor.components[componentKey2] || QWeb.components[componentKey2];
|
||||
if (!W2) {throw new Error('Cannot find the definition of component \\"' + componentKey2 + '\\"')}
|
||||
w2 = new W2(parent, props2);
|
||||
const __patch2 = w2.__patch;
|
||||
@@ -69,7 +69,7 @@ exports[`animations t-transition combined with t-component and t-if 1`] = `
|
||||
c1.push(pvnode);
|
||||
} else {
|
||||
let componentKey2 = \`Child\`;
|
||||
let W2 = context.constructor.components[componentKey2] || QWeb.components[componentKey2]|| scope['Child'];
|
||||
let W2 = scope['Child'] || context.constructor.components[componentKey2] || QWeb.components[componentKey2];
|
||||
if (!W2) {throw new Error('Cannot find the definition of component \\"' + componentKey2 + '\\"')}
|
||||
w2 = new W2(parent, props2);
|
||||
const __patch2 = w2.__patch;
|
||||
@@ -115,7 +115,7 @@ exports[`animations t-transition combined with t-component, remove and re-add be
|
||||
c1.push(pvnode);
|
||||
} else {
|
||||
let componentKey2 = \`Child\`;
|
||||
let W2 = context.constructor.components[componentKey2] || QWeb.components[componentKey2]|| scope['Child'];
|
||||
let W2 = scope['Child'] || context.constructor.components[componentKey2] || QWeb.components[componentKey2];
|
||||
if (!W2) {throw new Error('Cannot find the definition of component \\"' + componentKey2 + '\\"')}
|
||||
w2 = new W2(parent, props2);
|
||||
const __patch2 = w2.__patch;
|
||||
|
||||
Reference in New Issue
Block a user