Skip to content

Commit 2ba2ee3

Browse files
committed
update
1 parent fa6ff26 commit 2ba2ee3

File tree

3 files changed

+42
-20
lines changed

3 files changed

+42
-20
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"h5-vue-scroller": "^1.0.1",
1919
"normalize.css": "^8.0.1",
20-
"v-switcher": "^1.0.77",
20+
"v-switcher": "^1.0.78",
2121
"vue": "^2.6.10",
2222
"vue-flow-render": "^1.0.5",
2323
"vue-mixin-store": "^1.1.64",
@@ -31,13 +31,13 @@
3131
"@vue/eslint-config-standard": "^4.0.0",
3232
"babel-eslint": "^10.0.1",
3333
"core-js": "2.6.9",
34-
"eslint": "^6.2.0",
34+
"eslint": "^6.2.1",
3535
"eslint-plugin-vue": "^5.0.0",
3636
"faker": "^4.1.0",
3737
"node-sass": "^4.12.0",
3838
"nuxt": "^2.8.1",
3939
"sass": "^1.22.10",
40-
"sass-loader": "^7.2.0",
40+
"sass-loader": "^7.3.1",
4141
"vue-template-compiler": "^2.6.10"
4242
}
4343
}

pages/index.vue

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,10 @@
186186
@scroll-down="handlePullUp"
187187
@bottom="handleLoadMore"
188188
@refresh="handleRefresh"
189+
@refresh-end="handleRefreshEnd"
189190
>
190191
<ul class="ul-wrap">
192+
<Refresher ref="refresher" @refresh="getNewData" />
191193
<li class="hoz-wrap">
192194
<recommended ref="rec" />
193195
</li>
@@ -201,6 +203,7 @@
201203
count: 10
202204
}"
203205
:use-first-loading="true"
206+
:callback="handleDataCallback"
204207
>
205208
<waterfall ref="render" slot-scope="{ flow, count }" :total="count" :items="flow" />
206209
<!--
@@ -221,11 +224,13 @@
221224
import Waterfall from '../examples/components/Waterfall'
222225
import SingleList from '../examples/components/SingleList'
223226
import Recommended from '../examples/components/Recommended'
227+
import Refresher from '../examples/components/Refresher'
224228
import { getCarousel } from '../examples/utils/api'
225229
226230
export default {
227231
name: 'Index',
228232
components: {
233+
Refresher,
229234
Waterfall,
230235
SingleList,
231236
Recommended
@@ -280,8 +285,18 @@ export default {
280285
handleBtnClick () {
281286
alert('排序')
282287
},
283-
handleRefresh () {
288+
handleRefresh ({ offset }) {
284289
this.hiddenCarousel = false
290+
this.$refs.refresher[this.activeIndex].pull(offset)
291+
},
292+
handleRefreshEnd() {
293+
this.$refs.refresher[this.activeIndex].close()
294+
},
295+
getNewData() {
296+
this.$refs.loader[this.activeIndex].refresh(true)
297+
},
298+
handleDataCallback({ refresh }) {
299+
refresh && this.$refs.refresher[this.activeIndex].finish()
285300
}
286301
}
287302
}

yarn.lock

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3991,13 +3991,20 @@ eslint-scope@^5.0.0:
39913991
esrecurse "^4.1.0"
39923992
estraverse "^4.1.1"
39933993

3994-
eslint-utils@^1.3.0, eslint-utils@^1.3.1, eslint-utils@^1.4.0:
3994+
eslint-utils@^1.3.0, eslint-utils@^1.3.1:
39953995
version "1.4.0"
39963996
resolved "https://registry.npm.taobao.org/eslint-utils/download/eslint-utils-1.4.0.tgz#e2c3c8dba768425f897cf0f9e51fe2e241485d4c"
39973997
integrity sha1-4sPI26doQl+JfPD55R/i4kFIXUw=
39983998
dependencies:
39993999
eslint-visitor-keys "^1.0.0"
40004000

4001+
eslint-utils@^1.4.2:
4002+
version "1.4.2"
4003+
resolved "https://registry.npm.taobao.org/eslint-utils/download/eslint-utils-1.4.2.tgz?cache=0&sync_timestamp=1566297013046&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-utils%2Fdownload%2Feslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab"
4004+
integrity sha1-FmpRgO9qt+tGLxYv0ObyRj1zCas=
4005+
dependencies:
4006+
eslint-visitor-keys "^1.0.0"
4007+
40014008
eslint-visitor-keys@^1.0.0:
40024009
version "1.0.0"
40034010
resolved "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
@@ -4052,10 +4059,10 @@ eslint@^4.19.1:
40524059
table "4.0.2"
40534060
text-table "~0.2.0"
40544061

4055-
eslint@^6.2.0:
4056-
version "6.2.0"
4057-
resolved "https://registry.npm.taobao.org/eslint/download/eslint-6.2.0.tgz#4c42c20e3fc03f28db25f34ccba621a9a47e8b56"
4058-
integrity sha1-TELCDj/APyjbJfNMy6YhqaR+i1Y=
4062+
eslint@^6.2.1:
4063+
version "6.2.1"
4064+
resolved "https://registry.npm.taobao.org/eslint/download/eslint-6.2.1.tgz?cache=0&sync_timestamp=1566300526377&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint%2Fdownload%2Feslint-6.2.1.tgz#66c2e4fe8b6356b9f01e828adc3ad04030122df1"
4065+
integrity sha1-ZsLk/otjVrnwHoKK3DrQQDASLfE=
40594066
dependencies:
40604067
"@babel/code-frame" "^7.0.0"
40614068
ajv "^6.10.0"
@@ -4064,7 +4071,7 @@ eslint@^6.2.0:
40644071
debug "^4.0.1"
40654072
doctrine "^3.0.0"
40664073
eslint-scope "^5.0.0"
4067-
eslint-utils "^1.4.0"
4074+
eslint-utils "^1.4.2"
40684075
eslint-visitor-keys "^1.1.0"
40694076
espree "^6.1.0"
40704077
esquery "^1.0.1"
@@ -8655,16 +8662,16 @@ sass-graph@^2.2.4:
86558662
scss-tokenizer "^0.2.3"
86568663
yargs "^7.0.0"
86578664

8658-
sass-loader@^7.2.0:
8659-
version "7.2.0"
8660-
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-7.2.0.tgz#e34115239309d15b2527cb62b5dfefb62a96ff7f"
8661-
integrity sha512-h8yUWaWtsbuIiOCgR9fd9c2lRXZ2uG+h8Dzg/AGNj+Hg/3TO8+BBAW9mEP+mh8ei+qBKqSJ0F1FLlYjNBc61OA==
8665+
sass-loader@^7.3.1:
8666+
version "7.3.1"
8667+
resolved "https://registry.npm.taobao.org/sass-loader/download/sass-loader-7.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsass-loader%2Fdownload%2Fsass-loader-7.3.1.tgz#a5bf68a04bcea1c13ff842d747150f7ab7d0d23f"
8668+
integrity sha1-pb9ooEvOocE/+ELXRxUPerfQ0j8=
86628669
dependencies:
86638670
clone-deep "^4.0.1"
86648671
loader-utils "^1.0.1"
86658672
neo-async "^2.5.0"
86668673
pify "^4.0.1"
8667-
semver "^5.5.0"
8674+
semver "^6.3.0"
86688675

86698676
sass@^1.22.10:
86708677
version "1.22.10"
@@ -8725,7 +8732,7 @@ selfsigned@^1.10.4:
87258732
resolved "https://registry.npm.taobao.org/semver/download/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
87268733
integrity sha1-eQp89v6lRZuslhELKbYEEtyP+Ws=
87278734

8728-
semver@^6.0.0, semver@^6.1.1, semver@^6.1.2:
8735+
semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0:
87298736
version "6.3.0"
87308737
resolved "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
87318738
integrity sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=
@@ -9908,10 +9915,10 @@ uuid@^3.0.1, uuid@^3.3.2:
99089915
resolved "https://registry.npm.taobao.org/uuid/download/uuid-3.3.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
99099916
integrity sha1-G0r0lV6zB3xQHCOHL8ZROBFYcTE=
99109917

9911-
v-switcher@^1.0.77:
9912-
version "1.0.77"
9913-
resolved "https://registry.yarnpkg.com/v-switcher/-/v-switcher-1.0.77.tgz#be7c214fcdb82ebfce24c8de17be39b042cd6301"
9914-
integrity sha512-ve5LBTeK3HaAhqBu0cCMDqWZjX2rsBp8L4kvZQaZiC4D9LvcLbcyRZze/q9QMn1eaKV48Boq8xeart05D2lQvA==
9918+
v-switcher@^1.0.78:
9919+
version "1.0.78"
9920+
resolved "https://registry.npm.taobao.org/v-switcher/download/v-switcher-1.0.78.tgz#a87593d944f0b3a25c5c81b52eeb9e382a7a0bf2"
9921+
integrity sha1-qHWT2UTws6JcXIG1LuueOCp6C/I=
99159922
dependencies:
99169923
vue "^2.6.6"
99179924

0 commit comments

Comments
 (0)