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

feat: add suggestions num config #163

Merged
merged 2 commits into from
Apr 23, 2018

Conversation

sakihet
Copy link
Contributor

@sakihet sakihet commented Apr 20, 2018

i'd like to customize suggestions num.
what do you think?

config example:

module.exports = {
  themeConfig: {
    searchBox: {
      suggestionsMax: 10
    }
  }
}

@wangyi7099
Copy link
Contributor

Nice improvement

Copy link

@cajames cajames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sakihet This is a pretty useful idea! :)

Though what's the value of searchBox if a user doesn't enter this configuration in? I suspect searchBox would be undefined, and this would throw an error.

I'd recommend either keeping it at a flat level, like this.$site.themeConfig.maxSearchboxSuggestions, (Or adding more checks if you foresee more searchBox theme configs coming)

@sakihet
Copy link
Contributor Author

sakihet commented Apr 20, 2018

@wangyi7099 thanks

@sakihet sakihet force-pushed the add-suggestions-config branch from 8731459 to fbb838e Compare April 21, 2018 02:12
@sakihet
Copy link
Contributor Author

sakihet commented Apr 21, 2018

@cajames sure, i updated PR. please review again.

@yyx990803
Copy link
Member

I simplified it a little bit to use themeConfig.searchMaxSuggestions instead.

@yyx990803 yyx990803 merged commit a16a5b4 into vuejs:master Apr 23, 2018
meteorlxy added a commit that referenced this pull request Jun 17, 2021
Co-authored-by: meteorlxy <meteor.lxy@foxmail.com>
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

Successfully merging this pull request may close these issues.

4 participants