[FIX] playground: update example to owl 2

This commit is contained in:
Géry Debongnie
2021-12-21 15:09:02 +01:00
committed by Aaron Bohy
parent ce8ddd1cbf
commit 38941bc26f
3 changed files with 458 additions and 541 deletions
-2
View File
@@ -16,8 +16,6 @@ import { mainEventHandler } from "./component/handler";
import { Portal } from "./portal"; import { Portal } from "./portal";
export type { Reactive } from "./reactivity"; export type { Reactive } from "./reactivity";
config.shouldNormalizeDom = false; config.shouldNormalizeDom = false;
config.mainEventHandler = mainEventHandler; config.mainEventHandler = mainEventHandler;
(UTILS as any).Portal = Portal; (UTILS as any).Portal = Portal;
+2 -11
View File
@@ -39,18 +39,9 @@ function makeCodeIframe(js, css, xml) {
const script = doc.createElement("script"); const script = doc.createElement("script");
script.type = "module"; script.type = "module";
const content = ` const content = `
import * as utils from "./utils.js"; (async function(TEMPLATES) {
(function (owl) {
const _configure = owl.App.prototype.configure;
owl.App.prototype.configure = function configureOverriden(config) {
config = Object.assign({ dev: true }, config);
this.addTemplates(\`${sanitizedXML}\`);
return _configure.call(this, config);
}
})(owl);
(async function() {
${js} ${js}
})()`; })(\`${sanitizedXML}\`)`;
script.innerHTML = content; script.innerHTML = content;
doc.body.appendChild(script); doc.body.appendChild(script);
}); });
File diff suppressed because it is too large Load Diff