Skip to content

Commit

Permalink
fix: 调整导出方式,支持多种导入方式及types检查
Browse files Browse the repository at this point in the history
  • Loading branch information
gk-shi committed Dec 17, 2023
1 parent c4c39f8 commit e2eac1e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
14 changes: 8 additions & 6 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { App, Plugin } from 'vue'
import { App } from 'vue'
import V3waterfall from './v3-waterfall.vue'

export { V3waterfall }

V3waterfall.install = function (app: App) {
app.component(V3waterfall.name, V3waterfall)

return app
const V3waterfallInstance = {
install: (app: App): App => {
app.component(V3waterfall.name, V3waterfall)
return app
}
}

export default V3waterfall as typeof V3waterfall & Plugin
export default V3waterfallInstance
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,12 @@
"private": false,
"main": "./dist/v3-waterfall.umd.js",
"module": "./dist/v3-waterfall.es.js",
"types": "./dist/typings/index.d.ts",
"exports": {
"./dist/style.css": "./dist/style.css",
".": {
"import": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/v3-waterfall.es.js"
},
"require": {
"types": "./dist/typings/index.d.ts",
"default": "./dist/v3-waterfall.umd.js"
}
"import": "./dist/v3-waterfall.es.js",
"require": "./dist/v3-waterfall.umd.js"
}
},
"files": [
Expand Down

0 comments on commit e2eac1e

Please sign in to comment.