mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
feat: add markdown example
This commit is contained in:
parent
f2663033fc
commit
1e4c95554a
5
examples/markdownit/README.md
Normal file
5
examples/markdownit/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Markdown Example
|
||||
|
||||
> Convert Markdown file to HTML using markdown-it.
|
||||
|
||||
**See [Markdownit Module](https://github.com/nuxt-community/modules/tree/master/packages/markdownit) for easy integration with [Nuxt.js](https://nuxtjs.org).**
|
16
examples/markdownit/nuxt.config.js
Normal file
16
examples/markdownit/nuxt.config.js
Normal file
@ -0,0 +1,16 @@
|
||||
module.exports = {
|
||||
modules: [
|
||||
'@nuxtjs/markdownit'
|
||||
]
|
||||
// [optional] markdownit options
|
||||
// See https://github.com/markdown-it/markdown-it
|
||||
// markdownit: {
|
||||
// preset: 'default',
|
||||
// linkify: true,
|
||||
// breaks: true,
|
||||
// use: [
|
||||
// 'markdown-it-container',
|
||||
// 'markdown-it-attrs'
|
||||
// ]
|
||||
// }
|
||||
}
|
13
examples/markdownit/package.json
Normal file
13
examples/markdownit/package.json
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "nuxt-markdownit",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@nuxtjs/markdownit": "^1.1.2",
|
||||
"nuxt": "latest"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nuxt",
|
||||
"build": "nuxt build",
|
||||
"start": "nuxt start"
|
||||
}
|
||||
}
|
6
examples/markdownit/pages/about.vue
Normal file
6
examples/markdownit/pages/about.vue
Normal file
@ -0,0 +1,6 @@
|
||||
<template lang="md">
|
||||
# Hello World!
|
||||
Current route is: {{ $route.name }}
|
||||
|
||||
<nuxt-link to="/">Back home</nuxt-link>
|
||||
</template>
|
19
examples/markdownit/pages/index.vue
Normal file
19
examples/markdownit/pages/index.vue
Normal file
@ -0,0 +1,19 @@
|
||||
<template lang="md">
|
||||
# Hello World!
|
||||
|
||||
Current route is: {{ $route.path }}
|
||||
|
||||
Data model is: {{ model }}
|
||||
|
||||
<nuxt-link to="/about">Goto About</nuxt-link>
|
||||
</template>
|
||||
|
||||
<<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
model: 'abc'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user