-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
@shikijs/vitepress-twoslash
: Use twoslash in the case of using imported code snippets.
#682
Open
3 of 4 tasks
Labels
help-wanted
Extra attention is needed
Comments
我有同样的需求,但是我认为应当是如下格式,因为 #snippet 已被用作表示区域。 <<< @/components/App.vue{vue twoslash} debug 发现是 vitepress 的 snippetPlugin 未提供 meta。我已向 vitepress 提pr解决此问题。 |
@Thy3634 是的, 我就是需要使用 #snippet 来引用部分区域而不是整个文件, 而只需要对引用的区域能使 twoslash 生效就行了 |
所以不能用#snippet语法代表twoslash 两者需要同时或分别使用,这样使用 <<< @/components/App.vue#snipaste{vue twoslash} <!-- #region snipaste -->
<script setup lang="ts">
import { ref } from 'vue'
const message = ref('Hello world!')
</script>
<!-- #endregion snipaste -->
<template>
<input v-model="message" />
<p>{{ message }}</p>
</template> |
是的, 我的意思也是这样的, 只是当时想的定义方式不一样 😁 你这样是没问题的 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clear and concise description of the problem
希望可以在使用导入代码片段的情况下, 使用 twoslash
I hope to use twoslash when using imported code snippets.
Suggested solution
<<< ./src/types.ts twoslash
<<< ./src/types.ts#snippet twoslash
Alternative
No response
Additional context
No response
Validations
Contributes
The text was updated successfully, but these errors were encountered: