跳到主要内容

RemoveFieldWrapper

删除字段包装器,仅保留字段内容。

语法

expression.RemoveFieldWrapper(fieldId);

expression - 表示 Api 类的变量。

参数

名称必需/可选数据类型默认值描述
fieldId可选string字段 ID。如果未指定,则删除当前字段的包装器。

返回值

此方法不返回任何数据。

示例

window.Asc.plugin.executeMethod("GetAllAddinFields", null, function(fields) {
let count = 0;
fields.forEach(function(field) {
if (field.Value.includes(bibPrefix) || field.Value.includes(citPrefix)) {
count++;
window.Asc.plugin.executeMethod("RemoveFieldWrapper", [field.FieldId], function() {
count--;
if (!count)
window.Asc.plugin.executeCommand("close", "");
});
}
});

if (!fields.length)
window.Asc.plugin.executeCommand("close", "");
});