mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] can use t-out with String classes
This commit is contained in:
@@ -135,7 +135,7 @@ export function safeOutput(value: any): ReturnType<typeof toggler> {
|
||||
} else if (value instanceof LazyValue) {
|
||||
safeKey = `lazy_value`;
|
||||
block = value.evaluate();
|
||||
} else if (typeof value === "string") {
|
||||
} else if (value instanceof String || typeof value === "string") {
|
||||
safeKey = "string_unsafe";
|
||||
block = text(value);
|
||||
} else {
|
||||
|
||||
@@ -9,11 +9,11 @@ const characterDataSetData = getDescriptor(characterDataProto, "data").set!;
|
||||
const nodeRemoveChild = nodeProto.removeChild;
|
||||
|
||||
abstract class VSimpleNode {
|
||||
text: string;
|
||||
text: string | String;
|
||||
parentEl?: HTMLElement | undefined;
|
||||
el?: any;
|
||||
|
||||
constructor(text: string) {
|
||||
constructor(text: string | String) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class VComment extends VSimpleNode {
|
||||
patch() {}
|
||||
}
|
||||
|
||||
export function text(str: string): VNode<VText> {
|
||||
export function text(str: string | String): VNode<VText> {
|
||||
return new VText(str);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user