Skip to content

Commit

Permalink
Merge pull request #143 from AwesomeDevin/feat-vue3
Browse files Browse the repository at this point in the history
Feat: for vue3
  • Loading branch information
AwesomeDevin authored Nov 3, 2023
2 parents a16c434 + 5415429 commit 72183f7
Show file tree
Hide file tree
Showing 19 changed files with 1,087 additions and 4,341 deletions.
1 change: 1 addition & 0 deletions CHINESE-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* 4.提供Event:loadmore (pc/android端滑动到底部触发,ios端需要上拉触发)
* 5.使用极为简便, 适用于PC/ios/android

# Note: [email protected] 适用于 vue3, 如果你的应用是 vue2,请使用 [email protected], [1.10.x document](https://github.com/AwesomeDevin/vue-waterfall2/tree/1.10.6)

有问题欢迎提issues、suggestions;Thank you for your Star !
[welcome to my blog(JS/前端工程化/Python/算法) !!!](https://github.com/AwesomeDevin/blog)
Expand Down
12 changes: 9 additions & 3 deletions ENGLISH-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


#### [中文版文档](https://github.com/AwesomeDevin/vue-waterfall2/blob/master/CHINESE-README.md)

# Note: [email protected] is adapt for vue3, if your app is vue2, please use [email protected], [1.10.x document](https://github.com/AwesomeDevin/vue-waterfall2/tree/1.10.6)

# vue-waterfall2
1. auto adaption for width and height
2. High degree of customization
Expand All @@ -17,8 +20,8 @@ If you have some questions,welcome to describe issues、suggestions;Thank you fo


## Demo
[Common Demo](http://47.105.188.15:3001/)
[Lazyload Demo](http://47.105.188.15:3001/#/list)
[Common Demo](https://awesomedevin.github.io/vue-waterfall2/#/)
[Lazyload Demo](https://awesomedevin.github.io/vue-waterfall2/#/lazy)
[Code Demo](https://codesandbox.io/embed/vue-template-99ps6)


Expand Down Expand Up @@ -76,8 +79,11 @@ Notes:
2. Use the parent component of 'waterfall' if there is a problem with the style, remove CSS `scoped` and try it
##### main.js
```javascript
import { createApp } from "vue";
import waterfall from 'vue-waterfall2'
Vue.use(waterfall)

const app = createApp(App)
app.use(waterfall)
```
##### app.vue
```javascript
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@


#### [中文版文档](https://github.com/AwesomeDevin/vue-waterfall2/blob/master/CHINESE-README.md)

# Note: [email protected] is adapt for vue3, if your app is vue2, please use [email protected], [1.10.x document](https://github.com/AwesomeDevin/vue-waterfall2/tree/1.10.6)

# vue-waterfall2
1. auto adaption for width and height
2. High degree of customization
Expand Down Expand Up @@ -76,8 +79,11 @@ Notes:
2. Use the parent component of 'waterfall' if there is a problem with the style, remove CSS `scoped` and try it
##### main.js
```javascript
import { createApp } from "vue";
import waterfall from 'vue-waterfall2'
Vue.use(waterfall)

const app = createApp(App)
app.use(waterfall)
```
##### app.vue
```javascript
Expand Down
143 changes: 0 additions & 143 deletions main/README.md

This file was deleted.

28 changes: 25 additions & 3 deletions main/bus.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
import Vue from 'vue'
const bus = new Vue()
export default bus
class EventEmit{
constructor(){
this.events = {}
}
on(eventName, callback){
if(!this.events[eventName]){
this.events[eventName] = []
}
this.events[eventName].push(callback)
}
emit(eventName, ...args){
if(this.events[eventName]){
this.events[eventName].forEach(cb => {
cb(...args)
})
}
}
off(eventName, callback){
if(this.events[eventName]){
this.events[eventName] = this.events[eventName].filter(cb => cb !== callback)
}
}
}

export default new EventEmit()
Loading

0 comments on commit 72183f7

Please sign in to comment.