首页 > 其他分享 >This comparison appears to be unintentional because the types ‘“up “ | “down“‘ and ‘“up“‘ have no ov

This comparison appears to be unintentional because the types ‘“up “ | “down“‘ and ‘“up“‘ have no ov

时间:2024-10-14 17:20:59浏览次数:3  
标签:comparison because idList up down dir string

This comparison appears to be unintentional because the types '"up " | "down"' and '"up"' have no overlap. <ArkTSCheck>

 onToggle(dir: "up" | "down") {
    const idList = AppStorage.get('idList') as string[]
    idList.indexOf(this.questionId)
    if (dir === "up ") {

      return
    }

这个错误提示表明您正在进行的比较可能不是有意的,因为比较的两个类型 'up ' | 'down' 和 'up' 没有重叠部分。

可能您在代码中的某个条件判断中,将这两个不同类型的值进行了比较,而它们的可能取值没有共同之处,这可能不符合您的预期逻辑,您需要检查并修正比较的操作或数据类型。

之前up后面多了一个空格,删掉就好了

 onToggle(dir: "up" | "down") {
    const idList = AppStorage.get('idList') as string[]
    idList.indexOf(this.questionId)
    if (dir === "up") {

      return
    }
  }

标签:comparison,because,idList,up,down,dir,string
From: https://blog.csdn.net/hqy1989/article/details/142924110

相关文章

  • WriteUp - 江苏省领航杯 CTF 2024
    文章目录一、前言二、MISC高职组1、签到2、BASE拓展3、PG本科组1、签到2、veee3、seeme三、WEB高职组1、aio2、robots3、web_sql_xxe本科组1、web_sql_xxe2、提权3、acxi拓展四、CRYPTO高职组1、兔兔2、1zRSA本科组1、兔兔2、Evaluate五、REVERSE高职组1、eas......
  • 配置supermap iportal数据库,银河麒麟arm架构SP3系统中离线编译安装postgres、postgis
     一、安装环境准备postgresql-11.2.tar.gz、postgis-2.5.0.tar.gz文件,geos-3.6.1-12.ky10.aarch64.rpm包,再准备一台有外网的机器。如果遇到缺少的包,去有外网的机器下载,再考到内网机器里安装。大部分安装都是编译安装,遵循配置、编译、安装这三步。注意安装后的软件目录postgre......
  • Windows 11 绕过 TPM 方法总结,24H2 通用免 TPM 镜像下载 (Updated Oct 2024)
    Windows11绕过TPM方法总结,24H2通用免TPM镜像下载(UpdatedOct2024)在虚拟机、Mac电脑和TPM不符合要求的旧电脑上安装Windows11的通用方法总结请访问原文链接:https://sysin.org/blog/windows-11-no-tpm/查看最新版。原创作品,转载请保留出处。作者主页:sysin.org......
  • Veritas NetBackup 10.5 (Unix, Linux, Windows) - 领先的企业备份解决方案
    VeritasNetBackup10.5(Unix,Linux,Windows)-领先的企业备份解决方案The#1enterprisebackupandrecoverysolution.请访问原文链接:https://sysin.org/blog/veritas-netbackup-10/查看最新版。原创作品,转载请保留出处。作者主页:sysin.org备份和恢复软件解决方案领......
  • HTB:Jerry[WriteUP]
    目录连接至HTB服务器并启动靶机1.WhichTCPportisopenontheremotehost?2.Whichwebserverisrunningontheremotehost?Lookingfortwowords.3.WhichrelativepathonthewebserverleadstotheWebApplicationManager?4.Whatisthevalidusername......
  • HTB:Lame[WriteUP]
    目录连接至HTB服务器并启动靶机1.Howmanyofthenmaptop1000TCPportsareopenontheremotehost?2.WhatversionofVSFTPdisrunningonLame?3.ThereisafamousbackdoorinVSFTPdversion2.3.4,andaMetasploitmoduletoexploitit.Doesthatexploi......
  • HTB:Legacy[WriteUP]
    目录连接至HTB服务器并启动靶机1.HowmanyTCPportsareopenonLegacy?2.Whatisthe2008CVEIDforavulnerabilityinSMBthatallowsforremotecodeexecution?3.WhatisthenameoftheMetasploitmodulethatexploitsCVE-2008-4250?4.WhenexploitingM......
  • The 1st Universal Cup. Stage 22: Shaanxi
    Preface时隔一周之后难得开了场训练,然后犯了一堆弱智错误给自己搞红温了,最后感觉啥难题也没写就混着混着就结束了赛后想补题经典找不到题解,只搜到哥哥的题解结果搞不懂细节还是写不来一点,直接开摆D.AliceandBob首先博弈部分的结论很好猜,若第一次操作开头的数为\(x\),则若......
  • Error: error:0308010C:digital envelope routines::unsupported
    原因:运行Node.js应用程序时遇到了一个与加密算法相关的错误。具体来说,error:0308010C:digitalenveloperoutines::unsupported错误通常是因为Node.js尝试使用了一个不受支持的加密算法或选项,尤其是在使用某些依赖于OpenSSL的库时。主要是因为nodeJsV17版本发布了OpenSSL3.0......
  • 【Azure Cloud Service】使用RESTAPI更新Cloud Service(Extended Support) 中所配置的
    问题描述当根据CloudService(ExtendedSupport)文档更新证书(https://docs.azure.cn/zh-cn/cloud-services-extended-support/certificates-and-key-vault)时,如果遇见旧的证书(如中间证书,根证书)信息保存在KeyVaultSecret中,而更新的时候,只能从KeyVault证书中匹配到服务......