From 942cfe148091d32a6cdc4883f35dc582e2bade46 Mon Sep 17 00:00:00 2001 From: Emily Berkeley Date: Fri, 26 Oct 2018 12:22:58 -0400 Subject: [PATCH] Edits copy for clarity. --- docs/guide/use-with-filter-or-tabs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guide/use-with-filter-or-tabs.md b/docs/guide/use-with-filter-or-tabs.md index caf3bdc..83999a8 100644 --- a/docs/guide/use-with-filter-or-tabs.md +++ b/docs/guide/use-with-filter-or-tabs.md @@ -4,7 +4,7 @@ previewLink: //jsfiddle.net/PeachScript/w197rfy0/embedded/result/ # Use With Filter/Tabs -The loading process is exactly same as the previous example, the key point is how to reset the component when we changing filter or tabs. In fact, this component will reset itself whenever the `identifier` is changed, sounds ease, let's do it! +The loading process is exactly same as in the previous example. The key point here is how to reset the component when we change the filter or tabs. The infinite component will reset itself whenever the `identifier` property has changed. It sounds easy, so let's do it! ``` html {12}
@@ -21,7 +21,7 @@ The loading process is exactly same as the previous example, the key point is ho ``` -In the template, we add a `select` element and listen it's `change` event, for `InfiniteLoading` component, we add an `identifier` property. +In the template, we add a `select` element and listen its `change` event. For the `InfiniteLoading` component, we add an `identifier` property. ``` js {10,11,19,31,32,33,34,35} import axios from 'axios'; @@ -63,6 +63,6 @@ export default { }; ``` -In the script, we set default values for `select` and `identifier` property, then add the type parameter in API request logic. And we create the `changeType` method to reset the list data and infinite component, please pay attention, we must change the `identifier` property after empty list, if not, the component may not trigger the `infinite` event immediately after reset. +In the script, we set default values for `select` (`newsType: 'story'`) and `identifier` (`infiniteId: +new Date()`) properties, then add the type parameter in API request logic. And we create the `changeType` method to reset the list data and infinite component. Please note, we must change the `identifier` property (`this.infiniteId += 1`) *after* we empty the list (`this.list = []`). Otherwise, the component may not trigger the `infinite` event immediately after reset. -That's all, you have done it! +That's all, you're done!