[FIX] component: slots should preserve parented relation

closes #234
This commit is contained in:
Géry Debongnie
2019-07-09 16:38:30 +02:00
parent e24ff8f8aa
commit bfc7c81c0d
6 changed files with 109 additions and 36 deletions
+4 -2
View File
@@ -5,6 +5,7 @@ exports[`animations t-transition combined with component 1`] = `
) {
let utils = this.utils;
let QWeb = this.constructor;
let parent = context;
let owner = context;
var h = this.utils.h;
let c1 = [], p1 = {key:1};
@@ -27,7 +28,7 @@ exports[`animations t-transition combined with component 1`] = `
let componentKey4 = \`Child\`;
let W4 = context.components && context.components[componentKey4] || QWeb.components[componentKey4];
if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')}
w4 = new W4(owner, props4);
w4 = new W4(parent, props4);
context.__owl__.cmap[4] = w4.__owl__.id;
def3 = w4.__prepare();
def3 = def3.then(vnode=>{let pvnode=h(vnode.sel, {key: 4, hook: {insert(vn) {let nvn=w4.__mount(vnode, pvnode.elm);pvnode.elm=nvn.elm;utils.transitionInsert(vn, 'chimay');},remove() {},destroy(vn) {let finalize = () => {
@@ -48,6 +49,7 @@ exports[`animations t-transition combined with t-component and t-if 1`] = `
) {
let utils = this.utils;
let QWeb = this.constructor;
let parent = context;
let owner = context;
var h = this.utils.h;
let c1 = [], p1 = {key:1};
@@ -71,7 +73,7 @@ exports[`animations t-transition combined with t-component and t-if 1`] = `
let componentKey4 = \`Child\`;
let W4 = context.components && context.components[componentKey4] || QWeb.components[componentKey4];
if (!W4) {throw new Error('Cannot find the definition of component \\"' + componentKey4 + '\\"')}
w4 = new W4(owner, props4);
w4 = new W4(parent, props4);
context.__owl__.cmap[4] = w4.__owl__.id;
def3 = w4.__prepare();
def3 = def3.then(vnode=>{let pvnode=h(vnode.sel, {key: 4, hook: {insert(vn) {let nvn=w4.__mount(vnode, pvnode.elm);pvnode.elm=nvn.elm;utils.transitionInsert(vn, 'chimay');},remove() {},destroy(vn) {let finalize = () => {