Skip to content

Commit 22c0b3e

Browse files
committed
Fixed configuration rollup for plugin
1 parent 5f53193 commit 22c0b3e

File tree

2 files changed

+25
-4
lines changed

2 files changed

+25
-4
lines changed

build/rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import buble from 'rollup-plugin-buble'
33
import uglify from 'rollup-plugin-uglify-es'
44

55
export default {
6-
input: 'index.js',
6+
input: 'src/index.js',
77
output: {
88
name: 'VueTinyPagination',
99
exports: 'named'

src/index.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
1-
import TynyPagination from './components/TinyPagination'
1+
import TinyPagination from './src/components/TinyPagination.vue'
22

3-
export {
4-
TynyPagination
3+
const install = (Vue, opts ={}) => {
4+
if (install.installed) return
5+
install.installed = true
6+
Vue.component('TinyPagination', TinyPagination)
57
}
8+
9+
const plugin = {
10+
version: '0.2.1-beta.5',
11+
install,
12+
TinyPagination
13+
}
14+
15+
let GlobalVue = null
16+
if (typeof window !== 'undefined') {
17+
GlobalVue = window.Vue
18+
} else if (typeof global !== 'undefined') {
19+
GlobalVue = global.Vue
20+
}
21+
if (GlobalVue) {
22+
GlobalVue.use(plugin)
23+
}
24+
25+
module.exports = plugin
26+
module.exports.default = module.exports

0 commit comments

Comments
 (0)