Closed mouyong closed 2 years ago
It's working fine for me. You just have to remove empty lines from the html.
Can you provide your code? I want to know the different places with me.
@brc-dd you are right. when I remove all tailwindui empt line, it works.
I have another question: "how can i use alpinejs in vitepress?"
when i use https://alpinejs.dev/ homepage demo. it's not work.
in config.ts
export default Object.assign(userConfig, {
head: [
['script', { src: '//unpkg.com/alpinejs', defer: true }],
],
}
in custom page
---
layout: page
---
<div class="container w-3/4 mx-auto">
<div x-data="{ open: false }">
<button @click="open = true">Expand</button>
<span x-show="open">
Content...
</span>
</div>
</div>
when i click the Expand button, it doesn't have any action.
I want use tailwindui in custom page.
write the custom page by vue code or html + alphine code.
Tried some possibilities but failed: the tailwindui vue component install by npm, but use in markdown is not avaliable.
how can i do.
how can i use alpinejs in vitepress?
This will likely conflict with Vue as they have some common syntax like @click
. Why not simply use Vue in your markdown?
<div>
<button @click="open = !open">Expand</button>
<span v-if="open">
Content...
</span>
</div>
<script setup>
import { ref } from 'vue'
const open = ref(false)
</script>
I want to just use vue in project. when run the demo. it need import some component.
when i register component in theme/index.ts, it not work. So try use aplinejs to instead of vue script.
when i use x-on:click instaed of @click, it works. i have 2 question.
<div x-data="{ open: false }">
<button x-on:click="open = !open">Expand</button>
<span x-show="open">
Content...
</span>
</div>
That is directly working for me: https://stackblitz.com/edit/vite-jbapbj?file=docs%2Findex.md,docs%2FDropdownMenu.vue
why need remove html empty linke.
Empty lines tell the markdown that a block has ended. So if the content below that is indented then it'll treated like a code block.
The demo page is: https://mouyong.github.io/vitepress-doc-website/home.html
use in project: https://github.com/mouyong/vitepress-doc-website
Thanks for you. It will be help me very much.
That is directly working for me: https://stackblitz.com/edit/vite-jbapbj?file=docs%2Findex.md,docs%2FDropdownMenu.vue
why need remove html empty linke.
Empty lines tell the markdown that a block has ended. So if the content below that is indented then it'll treated like a code block.
Describe the bug
When use tailwindui in index.md. it throw the error
Reproduction
use the code: https://tailwindui.com/components/preview
Expected behavior
hope it can support html comment.
System Info
Additional context
No response
Validations