Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
0
Help us understand the problem. What is going on with this article?
@YutoYasunaga

Ruby on Rails アプリにVuetifyとFontAwesomeの導入

Vuetify導入

yarn add vuetify @fortawesome/fontawesome-free
app/javascript/packs/plugins/vuetify.js
import Vue from 'vue'
import Vuetify from 'vuetify'
import "vuetify/dist/vuetify.min.css"
import '@fortawesome/fontawesome-free/css/all.css'

Vue.use(Vuetify)
export default new Vuetify({
  icons: {
    iconfont: 'fa',
  }
})
app/javascript/packs/main.js
import vuetify from './plugins/vuetify'

document.addEventListener('DOMContentLoaded', () => {
  const app = new Vue({
    vuetify,
    render: h => h(App)
  }).$mount()
  document.body.appendChild(app.$el)
})

使用例

<v-icon>fas fa-home</v-icon>

FontAwesome導入

yarn add @fortawesome/fontawesome-svg-core @fortawesome/vue-fontawesome
app/javascript/packs/main.js
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
Vue.config.productionTip = false
Vue.component('FontAwesomeIcon', FontAwesomeIcon)

使用例

<FontAwesomeIcon icon="user"/>
<FontAwesomeIcon :icon="['far', 'star']"/>
<FontAwesomeIcon :icon="['fab', 'facebook']"/>
0
Help us understand the problem. What is going on with this article?
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
YutoYasunaga
こんにちは。 プログラミングは私の趣味の一つです。現在は東京でシステムエンジニアとして働いています。 C、C++、C#、Javaなどの言語を使ったことがありますが、ほとんどRuby on Railsフレームワークを使ったウエブサイトを開発しています。 豆知識をメモする為、他のエンジニアさんに共有する為、このサイトに色々投稿したいと思います。 宜しくお願い致します!

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
0
Help us understand the problem. What is going on with this article?