From 515331763d7d5ec0bb50f09bcc522532dc325d8c Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Sun, 19 Feb 2017 11:22:34 +0800 Subject: [PATCH] docs(plugin): add search doc --- docs/plugins.md | 10 ++++++++-- docs/zh-cn/plugins.md | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 180aefab4..8c2d4cfd3 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -23,7 +23,13 @@ By default, the hyperlink on the current page is recognized and the content is s search: { maxAge: 86400000, // Expiration time, the default one day paths: [], // or 'auto' - placeholder: 'Type to search' + placeholder: 'Type to search', + + // Localization + placeholder: { + '/zh-cn/': '搜索', + '/': 'Type to search' + } } } @@ -101,7 +107,7 @@ window.$docsify = { } ``` -!> You can get internal methods through `window.Docsify.utils`. +!> You can get internal methods through `window.Docsify`. Get the current instance through the second argument. #### Example diff --git a/docs/zh-cn/plugins.md b/docs/zh-cn/plugins.md index bb7d8ce9f..b5811d25f 100644 --- a/docs/zh-cn/plugins.md +++ b/docs/zh-cn/plugins.md @@ -23,7 +23,13 @@ search: { maxAge: 86400000, // 过期时间,单位毫秒,默认一天 paths: [], // or 'auto' - placeholder: 'Type to search' + placeholder: 'Type to search', + + // 支持本地化 + placeholder: { + '/zh-cn/': '搜索', + '/': 'Type to search' + } } } @@ -96,7 +102,7 @@ window.$docsify = { } ``` -!> 如果需要用 docsify 的内部方法,可以通过 `window.Docsify.utils` 获取。 +!> 如果需要用 docsify 的内部方法,可以通过 `window.Docsify` 获取,通过 `vm` 获取当前实例。 #### 例子