【发布时间】:2019-10-01 16:47:46
【问题描述】:
我有需要删除/添加的多行字符串 这是我要编辑的数据
data{
id
date
***progress{
update
progressStatus
}***
events {
id
time
}
}
我的意思是如何删除
progress{
update
progressStatus
}
我曾尝试使用“替换”、“分配”将其删除,如下所示,但不起作用
const test = data.replace(progress, '');
谢谢。
【问题讨论】:
-
请将您尝试过的代码添加到您的问题中,作为minimal reproducible example。
-
@ppppp 如果你想删除对象属性然后使用 delete data.progress;
-
特殊字符导致问题。正则表达式可能是您的问题的解决方案。
-
看起来像 graphql 查询,对吗?
-
@PatrickFerreira 是的
标签: javascript reactjs react-apollo