feat: web text support iconfont
This commit is contained in:
parent
bb6840cc40
commit
af2072ef25
11
doric-web/dist/index.js
vendored
11
doric-web/dist/index.js
vendored
@ -7202,6 +7202,13 @@ var doric_web = (function (exports, axios, sandbox) {
|
||||
v.style.alignItems = "center";
|
||||
}
|
||||
break;
|
||||
case "font":
|
||||
const fontLink = document.createElement('link');
|
||||
fontLink.rel = 'stylesheet';
|
||||
fontLink.href = `${prop}.css`;
|
||||
document.head.appendChild(fontLink);
|
||||
this.view.classList.add(prop);
|
||||
break;
|
||||
case "fontStyle":
|
||||
switch (prop) {
|
||||
case "bold":
|
||||
@ -7245,7 +7252,7 @@ var doric_web = (function (exports, axios, sandbox) {
|
||||
this.view.style.height = toPixelString(maxHeight);
|
||||
this.view.style.alignItems = "flex-start";
|
||||
this.view.style.overflow = 'hidden';
|
||||
this.view.textContent = this.getTruncationText(computedStyle, maxHeight);
|
||||
this.textElement.innerText = this.getTruncationText(computedStyle, maxHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -7259,7 +7266,7 @@ var doric_web = (function (exports, axios, sandbox) {
|
||||
return lineHeight;
|
||||
}
|
||||
getTruncationText(style, maxHeight) {
|
||||
const originalText = this.view.textContent;
|
||||
const originalText = this.textElement.innerText;
|
||||
let start = 0, end = originalText.length;
|
||||
const tempEle = document.createElement('div');
|
||||
tempEle.style.cssText = style.cssText;
|
||||
|
2
doric-web/dist/index.js.map
vendored
2
doric-web/dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@ -42,6 +42,13 @@ export class DoricTextNode extends DoricViewNode {
|
||||
v.style.alignItems = "center"
|
||||
}
|
||||
break
|
||||
case "font":
|
||||
const fontLink = document.createElement('link')
|
||||
fontLink.rel = 'stylesheet'
|
||||
fontLink.href = `${prop}.css`
|
||||
document.head.appendChild(fontLink)
|
||||
this.view.classList.add(prop)
|
||||
break
|
||||
case "fontStyle":
|
||||
switch (prop) {
|
||||
case "bold":
|
||||
@ -87,7 +94,7 @@ export class DoricTextNode extends DoricViewNode {
|
||||
this.view.style.height = toPixelString(maxHeight)
|
||||
this.view.style.alignItems = "flex-start"
|
||||
this.view.style.overflow = 'hidden'
|
||||
this.view.textContent = this.getTruncationText(computedStyle, maxHeight)
|
||||
this.textElement.innerText = this.getTruncationText(computedStyle, maxHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -103,7 +110,7 @@ export class DoricTextNode extends DoricViewNode {
|
||||
}
|
||||
|
||||
getTruncationText(style:CSSStyleDeclaration, maxHeight:number) {
|
||||
const originalText = this.view.textContent!
|
||||
const originalText = this.textElement.innerText
|
||||
let start = 0, end = originalText.length
|
||||
|
||||
const tempEle = document.createElement('div')
|
||||
|
Reference in New Issue
Block a user