Skip to content

Comments

解决当str不为string时, 导致includes方法不存在的问题#77

Open
sc834466168 wants to merge 1 commit intovite-plugin:mainfrom
sc834466168:main
Open

解决当str不为string时, 导致includes方法不存在的问题#77
sc834466168 wants to merge 1 commit intovite-plugin:mainfrom
sc834466168:main

Conversation

@sc834466168
Copy link

@sc834466168 sc834466168 commented Jan 2, 2025

<li v-for="(item, index) of chapterArr" :key="index" :class="index + 1 === chapterArr.length ? 'total-item' : 'total-item total-mg'" :style="background-image: url(${require(@/assets/images/home-bg${index+1}.png)})" ></li>

${index+1} 两个都会解析AcornNode,

  • index识别为BinaryExpression
  • 1识别为Literal

导致sanitizeString方法str非string, 当非string时视为表达式的内容设置为*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant