Skip to content

Commit 9bff927

Browse files
author
huangshuwei
committed
v1.1.0-beta.2
1 parent 64eb927 commit 9bff927

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-lazy-container",
3-
"version": "1.0.0",
3+
"version": "1.1.0-beta.2",
44
"description": "listening to the visibility of elements in the page",
55
"keywords": [
66
"vue",

src/index.jsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ export default {
88
type: String,
99
required: true
1010
},
11+
// id
12+
id: {
13+
type: [String, Number],
14+
default: ""
15+
},
1116
// IntersectionObserver option
1217
intersectionOption: {
1318
type: Object,
@@ -39,7 +44,7 @@ export default {
3944
createObserver() {
4045
const callback = (entries, observer) => {
4146
entries.forEach(entry => {
42-
this.$emit("change", entry, observer);
47+
this.$emit("change", entry, observer, this.id);
4348
});
4449
};
4550

@@ -59,9 +64,11 @@ export default {
5964
}
6065
},
6166
mounted() {
67+
console.log("created id ::",this.id)
6268
this.createObserver();
6369
},
6470
beforeDestroy() {
71+
console.log("destroied id ::",this.id)
6572
this.destroyObserver();
6673
},
6774
render() {

0 commit comments

Comments
 (0)