web:support text font style

This commit is contained in:
pengfei.zhou 2020-01-15 09:55:00 +08:00 committed by osborn
parent c92435f1e0
commit 2225514921

View File

@ -41,7 +41,24 @@ export class DoricTextNode extends DoricViewNode {
} }
break break
case "fontStyle": case "fontStyle":
v.style.fontWeight = "" switch (prop) {
case "bold":
v.style.fontWeight = "bold"
v.style.fontStyle = "normal"
break
case "italic":
v.style.fontWeight = "normal"
v.style.fontStyle = "italic"
break
case "bold_italic":
v.style.fontWeight = "bold"
v.style.fontStyle = "italic"
break
default:
v.style.fontWeight = "normal"
v.style.fontStyle = "normal"
break
}
break break
default: default:
super.blendProps(v, propName, prop) super.blendProps(v, propName, prop)