mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
fix: 修复 removeHTMLTag 可能出现的数据问题 (#2843)
This commit is contained in:
parent
f1b2a5cd33
commit
386c1de082
@ -507,7 +507,6 @@ export function isDisabled(
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
export function hasAbility(
|
||||
schema: any,
|
||||
ability: string,
|
||||
@ -1618,7 +1617,7 @@ export function detectPropValueChanged<
|
||||
|
||||
// 去掉字符串中的 html 标签,不完全准确但效率比较高
|
||||
export function removeHTMLTag(str: string) {
|
||||
return str.replace(/<\/?[^>]+(>|$)/g, '');
|
||||
return typeof str === 'string' ? str.replace(/<\/?[^>]+(>|$)/g, '') : str;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user