Skip to content

Commit 6efb0ef

Browse files
committed
Fix UNPKG version description
1 parent 52fe12f commit 6efb0ef

File tree

4 files changed

+26
-17
lines changed

4 files changed

+26
-17
lines changed

README.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,27 @@ See the demo sources in [demo/](demo/)
4848
## Installation
4949
### Using unpkg:
5050
```html
51-
<script src="https://unpkg.com/vue"></script>
52-
<script src="https://unpkg.com/@invisiburu/vue-picker"></script>
53-
<!-- optional css -->
54-
<link rel="stylesheet" href="https://unpkg.com/@invisiburu/vue-picker/dist/vue-picker.min.css">
51+
<head>
52+
<script src="https://unpkg.com/vue@3"></script>
53+
<script src="https://unpkg.com/@invisiburu/vue-picker"></script>
54+
<!-- optional css -->
55+
<link rel="stylesheet" href="https://unpkg.com/@invisiburu/vue-picker/dist/vue-picker.min.css">
56+
</head>
5557

5658
<body>
57-
<div id="#app"></div>
58-
<!-- ... -->
59-
59+
<div id="app"></div>
6060
<script>
61+
const App = {
62+
template:
63+
'<div>' +
64+
'<h3>Hello world</h3>' +
65+
'<VuePicker v-model="mv">' +
66+
'<VuePickerOption value="opt0">Option 0</VuePickerOption>' +
67+
'<VuePickerOption value="opt1">Option 1</VuePickerOption>' +
68+
'</VuePicker>' +
69+
'</div>',
70+
data: function () { return { mv: 'opt1' } },
71+
}
6172
const app = Vue.createApp(App)
6273
app.use(window.VuePicker)
6374
app.mount('#app')

build/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default {
1010
output: {
1111
name: 'VuePicker',
1212
exports: 'named',
13-
globals: { 'vue': 'Vue' }, // try remove
13+
globals: { 'vue': 'Vue' },
1414
},
1515
external: ['vue'],
1616
plugins: [

demo/lib/vue-picker.esm.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,6 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
382382
script$1.render = render$1;
383383
script$1.__file = "src/components/VuePicker.vue";
384384

385-
// TODO: unit tests
386-
387385
var script = {
388386
name: 'VuePickerOption',
389387

@@ -449,11 +447,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
449447
script.render = render;
450448
script.__file = "src/components/VuePickerOption.vue";
451449

452-
function install (Vue) {
450+
function install (vm) {
453451
if (install.installed) { return }
454452
install.installed = true;
455-
Vue.component('VuePicker', script$1);
456-
Vue.component('VuePickerOption', script);
453+
vm.component('VuePicker', script$1);
454+
vm.component('VuePickerOption', script);
457455
}
458456

459457
if (typeof window !== 'undefined') {

src/wrapper.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { VuePicker, VuePickerOption } from './index.js'
22

3-
export function install (Vue) {
3+
function install (vm) {
44
if (install.installed) return
55
install.installed = true
6-
Vue.component('VuePicker', VuePicker)
7-
Vue.component('VuePickerOption', VuePickerOption)
6+
vm.component('VuePicker', VuePicker)
7+
vm.component('VuePickerOption', VuePickerOption)
88
}
99

1010
if (typeof window !== 'undefined') {
@@ -13,4 +13,4 @@ if (typeof window !== 'undefined') {
1313
global.VuePicker = install
1414
}
1515

16-
export { VuePicker, VuePickerOption }
16+
export { VuePicker, VuePickerOption, install }

0 commit comments

Comments
 (0)