Skip to content

Commit c735f8d

Browse files
committed
feat: Add support for installing the component globally
1 parent dade5c6 commit c735f8d

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

docs/.vuepress/enhanceApp.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
import ColorPicker from '../../dist/vue-color-picker.esm.js';
22
import '../../dist/vue-color-picker.css';
33

4-
ColorPicker.install = function(Vue) {
5-
Vue.component('color-picker', ColorPicker);
6-
};
7-
84
export default ({ Vue }) => {
95
Vue.use(ColorPicker);
106
};

scripts/roll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const basePath = 'dist/vue-color-picker';
1111

1212
const build = async ({ format, minify = false }) => {
1313
const inputOptions = {
14-
input: './src/ColorPicker.vue',
14+
input: './src/wrapper.js',
1515
external: ['vue'],
1616
plugins: [
1717
// Replace env variable with 'production' for umd.min.js and 'development' for 'umd.js'

src/ColorPicker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import Rotator from '@radial-color-picker/rotator';
4040
4141
export default {
4242
rcp: null,
43-
name: 'vue-color-picker',
43+
name: 'ColorPicker',
4444
props: {
4545
hue: {
4646
default: 0,

src/wrapper.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import ColorPicker from './ColorPicker.vue';
2+
3+
ColorPicker.install = function(Vue) {
4+
Vue.component('ColorPicker', ColorPicker);
5+
};
6+
7+
export default ColorPicker;

0 commit comments

Comments
 (0)