判断网址是否存在,存在就不能添加,给出提示

226 阅读1分钟
if (sites.some(item => item.url == newUrl)) {
   showErrorInfo('网址已存在');
   return false;
}