Skip to content

Commit

Permalink
仅支持Vue 2版本
Browse files Browse the repository at this point in the history
  • Loading branch information
geofryzheng committed Mar 29, 2023
1 parent 84fca10 commit 0818303
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# vue-observer-directive

通过[`window.IntersectionObserver`](https://developer.mozilla.org/zh-CN/docs/Web/API/IntersectionObserver)判断DOM是否在视口展示,在Vue自定义指令中进行方法执行
通过[`window.IntersectionObserver`](https://developer.mozilla.org/zh-CN/docs/Web/API/IntersectionObserver)判断DOM是否在视口展示,在Vue@2自定义指令中进行方法执行

1. npm:<https://www.npmjs.com/package/vue-observer-directive>
2. demo:<https://realgeoffrey.github.io/vue-observer-directive/demo/index.html>
Expand All @@ -14,7 +14,7 @@
2. 浏览器引用

```html
<!-- 需要先引入vue:<script src="//unpkg.com/vue"></script> -->
<!-- 需要先引入vue:<script src="//unpkg.com/vue@2"></script> -->
<script src="//unpkg.com/vue-observer-directive"></script>
```

Expand Down Expand Up @@ -48,7 +48,7 @@
1. 全局注册
```html
<!-- 需要先引入vue:<script src="//unpkg.com/vue"></script> -->
<!-- 需要先引入vue:<script src="//unpkg.com/vue@2"></script> -->
<!-- 需要先引入vue-observer-directive:<script src="//unpkg.com/vue-observer-directive"></script> -->
<script>
Expand All @@ -60,7 +60,7 @@
2. 局部注册
```html
<!-- 需要先引入vue:<script src="//unpkg.com/vue"></script> -->
<!-- 需要先引入vue:<script src="//unpkg.com/vue@2"></script> -->
<!-- 需要先引入vue-observer-directive:<script src="//unpkg.com/vue-observer-directive"></script> -->
<script>
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
</p>
</div>

<script src="//unpkg.com/vue"></script>
<script src="//unpkg.com/vue@2"></script>
<script src="//unpkg.com/vue-observer-directive"></script>
<!-- <script src="../dist/vue-observer-directive.iife.js"></script> -->

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-observer-directive",
"description": "使用 IntersectionObserver 进行是否展示 DOM 判断(Vue自定义指令",
"description": "使用 IntersectionObserver 进行是否展示 DOM 判断(Vue@2自定义指令",
"repository": {
"type": "git",
"url": "git@github.com:realgeoffrey/vue-observer-directive.git"
Expand Down Expand Up @@ -33,5 +33,5 @@
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-terser": "^5.1.2"
},
"version": "1.2.4"
"version": "1.2.5"
}

0 comments on commit 0818303

Please sign in to comment.