docs: add nuxt3 example (#201)

This commit is contained in:
Robert Soriano 2022-06-27 23:18:08 -07:00 committed by GitHub
parent 17b947b27d
commit 6d855d2a53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 0 deletions

8
examples/nuxt3/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
node_modules
*.log*
.nuxt
.nitro
.cache
.output
.env
dist

42
examples/nuxt3/README.md Normal file
View File

@ -0,0 +1,42 @@
# Nuxt 3 Minimal Starter
Look at the [nuxt 3 documentation](https://v3.nuxtjs.org) to learn more.
## Setup
Make sure to install the dependencies:
```bash
# yarn
yarn install
# npm
npm install
# pnpm
pnpm install --shamefully-hoist
```
## Development Server
Start the development server on http://localhost:3000
```bash
npm run dev
```
## Production
Build the application for production:
```bash
npm run build
```
Locally preview production build:
```bash
npm run preview
```
Checkout the [deployment documentation](https://v3.nuxtjs.org/guide/deploy/presets) for more information.

16
examples/nuxt3/app.vue Normal file
View File

@ -0,0 +1,16 @@
<script setup lang="ts">
import { Editor } from '@bytemd/vue-next'
import gfm from '@bytemd/plugin-gfm'
const content = ref('')
const plugins = [gfm()]
const handleChange = (v: string) => {
content.value = v
}
</script>
<template>
<ClientOnly>
<Editor :value="content" :plugins="plugins" @change="handleChange" />
</ClientOnly>
</template>

View File

@ -0,0 +1,6 @@
import { defineNuxtConfig } from 'nuxt'
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
css: ['bytemd/dist/index.css']
})

View File

@ -0,0 +1,17 @@
{
"name": "@bytemd/example-nuxt3",
"scripts": {
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview"
},
"devDependencies": {
"nuxt": "3.0.0-rc.4"
},
"dependencies": {
"@bytemd/plugin-gfm": "latest",
"@bytemd/vue-next": "latest",
"bytemd": "latest"
}
}

View File

@ -0,0 +1,4 @@
{
// https://v3.nuxtjs.org/concepts/typescript
"extends": "./.nuxt/tsconfig.json"
}