TomokiMiyauci / me

About me
https://miyauchi.dev
MIT License
18 stars 11 forks source link

posts/start-vitepress/ #258

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Create a document with VitePress | miyauci.me

Introduce the basic usage of VitePress,multilingual support, homepage layout, meta tag injection, custom CSS, custom component and so on.

https://miyauchi.dev/posts/start-vitepress/?utterances=0cda0023ad4a6e8d13386ae6T6bTd4r%2BFA97wAONCPSYj6nGhZ%2BGAi4is5QF6nghTFWFh07vd6wkTqoMdHVLLYU9CSQ6kW84reyDjXJf1fpWQR%2FMuGkJCWsB6qcPIdg6C6vskQkKHhZW0eJwV18%3D

prashantnirgun commented 2 years ago

is there is any way to embed vue code into .md file like this instead of importing component and use it. Code is bellow

# Training
## what is count ? {{ count}}
<template>
  <div>{{count}}</div>
</template>
<script setup>
  import { ref } from 'vue';  
  const count = ref(10);
</script>
TomokiMiyauci commented 2 years ago

@prashantnirgun "vitepress": "^0.22.2"

You try the following.

# Training
## what is count ? {{ count }}

<script setup>
 import { ref } from 'vue';
 const count = ref(0)
</script>

<button v-on:click="count +=1">inc</button>
prashantnirgun commented 2 years ago

No let me re-phase it I want can we use markdown and templates both in test.md file. I checked it works without template that is fine.

TomokiMiyauci commented 2 years ago

@prashantnirgun I'm not sure what you want to do. Do you mean you want to use the template tag itself in .md files? 

prashantnirgun commented 2 years ago

Yes is it possible ?

TomokiMiyauci commented 2 years ago

@prashantnirgun You can do this.

# Training
## what is count ? {{ count}}

<component is="template">
  <div>{{count}}</div>
</component>

<script setup>
  import { ref } from 'vue';
  const count = ref(10);
</script>
keanesnow98 commented 1 year ago

Actually, this is apart from code, but can I see scroll bar? This is all so inconvenient to use mouse scroll every time.