Help us understand the problem. What is going on with this article?

[Nuxt] VueライブラリをNuxtに追加する

やること

MarkdownエディタをNuxtのプロジェクトに導入してみる。

miaolz123/vue-markdown

コード

$ yarn add vue-markdown --save
~/plugins/vue-markdown.js
import Vue from 'vue'
import VueMarkdown from 'vue-markdown'

Vue.use(VueMarkdown)
~/nuxt-config.js
export default {
  plugins: ['~/plugins/vue-makrdown']
}

アプリケーションを再起動し、configを読ませる。

~/pages/index.vue
<template>
  <vue-markdown>**this** is the default slot</vue-markdown>
</template>
<script>
import VueMarkdown from 'vue-markdown'
export default {
  components: {
    VueMarkdown
  }
}
</script>

まとめ

  • 基本的にVueライブラリの導入方法を、plugins配下に置き、nuxt.config.jsに記述すればいい感じかな?

参考

Vue プラグイン
Vue.jsでMarkdownをパースするためのvue-markdownの紹介と絵文字サジェストを作った話

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした