Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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