@fortawesome/vue-fontawesome
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -12,4 +12,7 @@ { | ||
"dependencies": { | ||
"@fortawesome/fontawesome": "^0.0.4", | ||
"@fortawesome/fontawesome-solid": "^0.0.4", | ||
"@fortawesome/fontawesome": "^0.0.7", | ||
"@fortawesome/fontawesome-brands": "^0.0.7", | ||
"@fortawesome/fontawesome-light": "^0.0.7", | ||
"@fortawesome/fontawesome-regular": "^0.0.7", | ||
"@fortawesome/fontawesome-solid": "^0.0.7", | ||
"vue": "^2.3.3" | ||
@@ -16,0 +19,0 @@ }, |
import Vue from 'vue' | ||
import App from './App.vue' | ||
import fontawesome from '@fortawesome/fontawesome' | ||
import { faCoffee } from '@fortawesome/fontawesome-solid' | ||
import FontAwesomeIcon from '@fortawesome/vue-fontawesome' | ||
fontawesome.library.add(faCoffee) | ||
Vue.component('font-awesome-icon', FontAwesomeIcon) | ||
@@ -6,0 +10,0 @@ |
{ | ||
"name": "@fortawesome/vue-fontawesome", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "index.js", | ||
@@ -21,5 +21,6 @@ "author": "robmadole <robmadole@gmail.com>", | ||
}, | ||
"peerDependencies": {}, | ||
"peerDependencies": { | ||
"@fortawesome/fontawesome": "^0.0.7" | ||
}, | ||
"devDependencies": { | ||
"@fortawesome/fontawesome": "^0.0.3", | ||
"babel-jest": "^20.0.3", | ||
@@ -26,0 +27,0 @@ "babel-preset-env": "^1.6.0", |
@@ -8,18 +8,47 @@ import fontawesome from '@fortawesome/fontawesome' | ||
props: { | ||
icon: { | ||
name: { | ||
type: String, | ||
default: '' | ||
}, | ||
pack: { | ||
type: String, | ||
default: 'fa' | ||
}, | ||
iconDefinition: { | ||
type: Object, | ||
required: true | ||
default: null | ||
} | ||
}, | ||
render (h) { | ||
const { abstract } = fontawesome.icon(this.icon) | ||
const convertCurry = convert.bind(null, h) | ||
data () { | ||
return { | ||
packNames: { | ||
brands: 'fab', | ||
light: 'fal', | ||
regular: 'far', | ||
solid: 'fas' | ||
} | ||
} | ||
}, | ||
if (abstract.length === 1) { | ||
return convertCurry(abstract[0]) | ||
} else { | ||
return h('span', abstract.map(convertCurry)) | ||
computed: { | ||
prefix () { | ||
return this.packNames[this.pack] || this.pack | ||
}, | ||
iconConfig () { | ||
return { prefix: this.prefix, iconName: this.name } | ||
}, | ||
icon () { | ||
return fontawesome.icon(this.iconDefinition || this.iconConfig) | ||
} | ||
}, | ||
render (createElement) { | ||
const { abstract } = this.icon | ||
const convertCurry = convert.bind(null, createElement) | ||
return convertCurry(abstract[0]) | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274594
12
21
364
2
1