LoginSignup
8
4

More than 5 years have passed since last update.

Nuxt.jsでVuesaxを使う方法

Posted at

68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3238393137332f35376534336161382d303163622d376632332d633262322d6437323964383065653036372e706e67.png

備忘録として。たぶんNuxt.jsのドキュメントをちゃんと読んでる人なら見なくていい記事。

どうやるか

これ通り。ただ、Nuxt.js内にpluginsにプラグインファイルを追加してnuxt.config.jsをちょっといじる必要がある。
Getting Started | Vue.js Framework Components - Vuesax

npm install vuesax --save
npm install material-icons --save
plugins/vuesax.js
import Vue from 'vue'
import Vuesax from 'vuesax'
import 'vuesax/dist/vuesax.css'
import 'material-icons/iconfont/material-icons.css';

Vue.use(Vuesax)
nuxt.config.js
  plugins: [
    { src: '~plugins/vuesax.js' }
  ]

使い方

これまんま
Buttons - ssr | Vue.js Framework Components - Vuesax

<template>
  <div>
    <vs-button vs-color="primary" vs-type="filled">Primary</vs-button>
    <vs-button vs-color="success" vs-type="filled">Success</vs-button>
    <vs-button vs-color="danger" vs-type="filled">Danger</vs-button>
    <vs-button vs-color="warning" vs-type="filled">Warning</vs-button>
    <vs-button vs-color="dark" vs-type="filled">Dark</vs-button>
    <vs-button vs-color="rgb(134, 4, 98)" vs-type="filled">RGB</vs-button>
    <vs-button disabled vs-type="filled">Disabled</vs-button>
  </div>
</template>

<script>
</script>

<style>
</style>

image.png

ᕙ( 'ω') オッシャレー

その他

@nuxtjs/vuesaxとかだれか出してくれんかな?

8
4
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
4