Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlgoliaSearchBox的配置项options问题 #234

Closed
pedrogao opened this issue Apr 24, 2018 · 1 comment
Closed

AlgoliaSearchBox的配置项options问题 #234

pedrogao opened this issue Apr 24, 2018 · 1 comment

Comments

@pedrogao
Copy link

默认主题代码是:

isAlgoliaSearch () {
 const algolia = this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {}
 return algolia && algolia.apiKey && algolia.indexName
}

但在html里面:

<AlgoliaSearchBox v-if="isAlgoliaSearch" :options="algolia" />

会报错无法找到options。
因此修改为:

algolia() {
 return (
  this.$themeLocaleConfig.algolia || this.$site.themeConfig.algolia || {}
  );
},
isAlgoliaSearch() {
  return this.algolia && this.algolia.apiKey && this.algolia.indexName;
}

ok!

@ulivz ulivz closed this as completed in b19bd89 Apr 24, 2018
@ulivz
Copy link
Member

ulivz commented Apr 24, 2018

Thanks, fixed at b19bd89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants