feat: add markdown example

This commit is contained in:
Clark Du 2017-10-28 00:20:12 +08:00
parent f2663033fc
commit 1e4c95554a
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9
5 changed files with 59 additions and 0 deletions

View 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).**

View 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'
// ]
// }
}

View 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"
}
}

View File

@ -0,0 +1,6 @@
<template lang="md">
# Hello World!
Current route is: {{ $route.name }}
<nuxt-link to="/">Back home</nuxt-link>
</template>

View 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>