Vuetify導入
Copy
1
| yarn add vuetify @fortawesome/fontawesome-free
|
Copy
app/javascript/packs/plugins/vuetify.js
1
2
3
4
5
6
7
8
9
10
11
| 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',
}
})
|
Copy
app/javascript/packs/main.js
1
2
3
4
5
6
7
8
9
| import vuetify from './plugins/vuetify'
document.addEventListener('DOMContentLoaded', () => {
const app = new Vue({
vuetify,
render: h => h(App)
}).$mount()
document.body.appendChild(app.$el)
})
|
使用例
Copy
html
1
| <v-icon>fas fa-home</v-icon>
|
FontAwesome導入
Copy
1
| yarn add @fortawesome/fontawesome-svg-core @fortawesome/vue-fontawesome
|
Copy
app/javascript/packs/main.js
1
2
3
| import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
Vue.config.productionTip = false
Vue.component('FontAwesomeIcon', FontAwesomeIcon)
|