Skip to content

Commit

Permalink
Support for FontAwesomeLayers and FontAwesomeLayersText added, depend…
Browse files Browse the repository at this point in the history
…encies updated, closes #7
  • Loading branch information
vaso2 committed Dec 24, 2018
1 parent 715786f commit 965ad42
Show file tree
Hide file tree
Showing 4 changed files with 8,948 additions and 9,305 deletions.
10 changes: 8 additions & 2 deletions lib/module.js
@@ -1,12 +1,18 @@
const {resolve} = require('path')
const { resolve } = require('path')

module.exports = async function module (moduleOptions) {
const defaults = {
component: 'font-awesome-icon',
component: '',
suffix: '',
imports: []
}
const options = Object.assign(defaults, this.options.fontawesome, moduleOptions)

if (!options.component || options.suffix) {
options.suffix = '-icon'
}
options.component = options.component || 'font-awesome'

this.options.css.unshift('@fortawesome/fontawesome-svg-core/styles.css')
this.addPlugin({
src: resolve(__dirname, './templates/plugin.js'),
Expand Down
6 changes: 4 additions & 2 deletions lib/templates/plugin.js
@@ -1,6 +1,6 @@
import Vue from 'vue'
import { library, config } from '@fortawesome/fontawesome-svg-core'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from '@fortawesome/vue-fontawesome'

config.autoAddCss = false

Expand All @@ -12,4 +12,6 @@ config.autoAddCss = false
<% }) %>
<% }) %>

Vue.component('<%=options.component%>', FontAwesomeIcon)
Vue.component('<%=options.component%><%=options.suffix%>', FontAwesomeIcon)
Vue.component('<%=options.component%>-layers', FontAwesomeLayers)
Vue.component('<%=options.component%>-layers-text', FontAwesomeLayersText)

0 comments on commit 965ad42

Please sign in to comment.