Skip to content

Commit e639fe6

Browse files
committed
Improve trigger manually documentation
1 parent 5f7bd82 commit e639fe6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/components/TriggerManually.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
<template>
22
<h3>Trigger manually</h3>
3-
<p>In most cases, we hope load data immediately for the empty list, it is also the default behavior of this component.</p>
4-
<p>But in some special cases, you may want to trigger load action through a click or other manual behavior, there has a workaround to implement it, for example, we need to load data manually every three pages:</p>
3+
<p>In most cases, we hope load data immediately for the empty list, it is also the default behavior of this component. And if you only want to control the first load, you can simply use the <code>v-if</code> and <code>v-else</code> directive to implement it:</p>
4+
<pre v-highlightjs>
5+
...
6+
&lt;button @click=&quot;isTriggerFirstLoad = true&quot; v-if=&quot;!isTriggerFirstLoad&quot;&gt;Load more&lt;/button&gt;
7+
&lt;infinite-loading v-else&gt;&lt;/infinite-loading&gt;
8+
...</pre>
9+
<p>And in some complex cases, for example, we need to load data manually every three pages, we can use the following workaroung to implement it:</p>
510

611
<h4>Template</h4>
712
<pre v-highlightjs v-if="$parent.docVersion < 2">&lt;div class=&quot;hacker-news-list&quot;&gt;

0 commit comments

Comments
 (0)