Skip to content

Commit

Permalink
docs: Fix a broken link at the Smart Query page (vuejs#911)
Browse files Browse the repository at this point in the history
* docs: Fix a broken link at the Smart Query page

* fix the link of the Chineses version one too
  • Loading branch information
KunHwanAhn authored and Akryum committed Jan 19, 2020
1 parent b8ad10b commit 85d9d06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/docs/src/api/smart-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Each query declared in the `apollo` definition (that is, which doesn't start wit
- `debounce`: debounce variables updates (in ms).
- `pollInterval`: auto update using polling (which means refetching every `x` ms). Default: `undefined`, `0` - stop polling.
- `update(data) {return ...}` to customize the value that is set in the vue property, for example if the field names don't match.
- `result(ApolloQueryResult, key)` is a hook called when a result is received (see documentation for [ApolloQueryResult](https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/types.ts)). `key` is the query key in the `apollo` option.
- `result(ApolloQueryResult, key)` is a hook called when a result is received (see documentation for [ApolloQueryResult](https://github.com/apollographql/apollo-client/blob/master/src/core/types.ts)). `key` is the query key in the `apollo` option.
- `error(error, vm, key, type, options)` is a hook called when there are errors. `error` is an Apollo error object with either a `graphQLErrors` property or a `networkError` property. `vm` is the related component instance. `key` is the smart query key. `type` is either `'query'` or `'subscription'`. `options` is the final `watchQuery` options object.
- `loadingKey` will update the component data property you pass as the value. You should initialize this property to `0` in the component `data()` hook. When the query is loading, this property will be incremented by 1; when it is no longer loading, it will be decremented by 1. That way, the property can represent a counter of currently loading queries.
- `watchLoading(isLoading, countModifier)` is a hook called when the loading state of the query changes. The `countModifier` parameter is either equal to `1` when the query is loading, or `-1` when the query is no longer loading.
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/src/zh-cn/api/smart-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- `debounce`:变量更新防抖时间(毫秒)。
- `pollInterval`:使用轮询自动更新的时间(表示每隔 `x` 毫秒重新获取一次)。
- `update(data) {return ...}` 用来自定义设置到 vue 属性中的值,例如当字段名称不匹配时。
- `result(ApolloQueryResult, key)` 是收到结果时调用的钩子(更多参见 [ApolloQueryResult](https://github.com/apollographql/apollo-client/blob/master/packages/apollo-client/src/core/types.ts) 的文档)。`key` 是在 `apollo` 选项中定义此查询时使用的键名。
- `result(ApolloQueryResult, key)` 是收到结果时调用的钩子(更多参见 [ApolloQueryResult](https://github.com/apollographql/apollo-client/blob/master/src/core/types.ts) 的文档)。`key` 是在 `apollo` 选项中定义此查询时使用的键名。
- `error(error, vm, key, type, options)` 是出现错误时调用的钩子。`error` 是一个具有 `graphQLErrors` 属性或 `networkError` 属性的 Apollo 错误对象。`vm` 是关联组件的实例。`key` 是智能查询的键名。`type``'query'``'subscription'` 中的一项。`options` 是最终的 `watchQuery` 选项对象。
- `loadingKey` 将更新你传递的值所对应的组件数据属性。你应该在组件的 `data()` 钩子中将此属性初始化为 `0` 。当查询正在加载时,此属性将增加 1;当不再加载时,它将减去 1。这样,该属性可以表示当前正在加载中的查询的计数器。
- `watchLoading(isLoading, countModifier)` 是一个在查询的加载状态发生变化时调用的钩子。`countModifier` 参数当查询正在加载时等于 `1`,不再加载时为 `-1`
Expand Down

0 comments on commit 85d9d06

Please sign in to comment.