Skip to content

Commit da1b63f

Browse files
author
李杰
committed
修复不支持object.assign
1 parent b43b081 commit da1b63f

File tree

5 files changed

+9
-28
lines changed

5 files changed

+9
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ StickyNav会在页面到达导航条位置的时候吸顶,超过父容器高
44

55
## Demo
66

7-
[Live demo](https://eijil.github.io/vue-sticky-nav/)
7+
[Live demo](http://vue-sticky-nav.surge.sh)
88

99
## install
1010

dist/build.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"dependencies": {
1414
"@tweenjs/tween.js": "^18.3.2",
15+
"lodash": "^4.17.15",
1516
"vue": "^2.6.10",
1617
"vue-sticky-nav": "^1.1.9"
1718
},

src/compontents/vue-sticky-nav/throttle.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/compontents/vue-sticky-nav/vue-sticky-nav.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,11 @@
4949
</template>
5050

5151
<script>
52-
import {throttle} from "./throttle.js";
52+
53+
import assign from 'lodash/assign';
54+
import throttle from 'lodash/throttle';
5355
import TWEEN from "@tweenjs/tween.js";
56+
5457
const DEFAULT_OPTIONS = {
5558
zIndex: 1000,
5659
stickyTop: 0,
@@ -81,7 +84,7 @@ export default {
8184
}
8285
},
8386
created() {
84-
this.stickyOptions = Object.assign({}, DEFAULT_OPTIONS, this.options);
87+
this.stickyOptions = assign({}, DEFAULT_OPTIONS, this.options);
8588
this.navs = this.stickyOptions.navs;
8689
},
8790
watch: {

0 commit comments

Comments
 (0)