Skip to content

fix: make sure at prop is greater than 0#2190

Merged
antfu merged 1 commit into
slidevjs:mainfrom
yuyinws:fix/at-prop-min
Jun 2, 2025
Merged

fix: make sure at prop is greater than 0#2190
antfu merged 1 commit into
slidevjs:mainfrom
yuyinws:fix/at-prop-min

Conversation

@yuyinws

@yuyinws yuyinws commented May 30, 2025

Copy link
Copy Markdown
Contributor

resolve #1611

Description

On shiki-magic-move and VSwitch, when set at prop less than 1, the behavior is strange. This PR make sure the at prop always greater than 0, and will print a warning message on console when at prop less than 1.

* *
Before CleanShot 2025-05-30 at 15 09 12
After CleanShot 2025-05-30 at 15 11 53
slide content {at:0}
---
theme: default
highlighter: shiki
layout: two-cols
layoutClass: gap-10
---

````md magic-move {at:0}
```js
cosnole.log('step 1')
```

```js
cosnole.log('step 2')
```

```js
cosnole.log('step 3')
```
````

::right::

<v-switch at="0">
<template #0>
step 1
</template>
<template #1>
step 2
</template>
<template #2>
step 3
</template>
</v-switch>

---

@netlify

netlify Bot commented May 30, 2025

Copy link
Copy Markdown

Deploy Preview for slidev ready!

Name Link
🔨 Latest commit c2a2f61
🔍 Latest deploy log https://app.netlify.com/projects/slidev/deploys/68395ba914b9ff0008ea0a32
😎 Deploy Preview https://deploy-preview-2190--slidev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented May 30, 2025

Copy link
Copy Markdown

Open in StackBlitz

@slidev/client

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/client@2190

create-slidev

npm i https://pkg.pr.new/slidevjs/slidev/create-slidev@2190

create-slidev-theme

npm i https://pkg.pr.new/slidevjs/slidev/create-slidev-theme@2190

@slidev/parser

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/parser@2190

@slidev/cli

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/cli@2190

@slidev/types

npm i https://pkg.pr.new/slidevjs/slidev/@slidev/types@2190

commit: c2a2f61

@antfu
antfu merged commit 467ceed into slidevjs:main Jun 2, 2025
@yuyinws
yuyinws deleted the fix/at-prop-min branch June 3, 2025 01:13
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.

Misleading behavior when setting at to 0

2 participants