vue-jcrop
Version:
The Javascript cropping widget for Vue.js
35 lines (28 loc) • 679 B
JavaScript
import Jcrop from './components/Jcrop.vue'
import { Rect } from 'jcrop'
// Install the components
export function install (Vue) {
Vue.component('Jcrop', Jcrop)
/* -- Add more components here -- */
}
// Expose the components
export { Jcrop, Rect }
/* -- Plugin definition & Auto-install -- */
/* You shouldn't have to modify the code below */
// Plugin
const plugin = {
/* eslint-disable no-undef */
version: VERSION,
install,
}
export default plugin
// Auto-install
let GlobalVue = null
if (typeof window !== 'undefined') {
GlobalVue = window.Vue
} else if (typeof global !== 'undefined') {
GlobalVue = global.Vue
}
if (GlobalVue) {
GlobalVue.use(plugin)
}