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

About Multiple Sidebars fallback of redirect #970

Closed
my9074 opened this issue Oct 30, 2018 · 4 comments
Closed

About Multiple Sidebars fallback of redirect #970

my9074 opened this issue Oct 30, 2018 · 4 comments

Comments

@my9074
Copy link

my9074 commented Oct 30, 2018

Bug report

In Multiple Sidebars mode, I can't config sidebar to redirect /components/ with / root path

directory structure:

├── components
│   ├── README.md
│   ├── i18n.md
│   ├── quickstart.md
│   └── text.md
└── guide
    └── FAQ.md

config.js

sidebar: {
   '/components/': [
     '',
     ['quickstart', 'Quick Start'],
     ['i18n', 'Internationalization'],
     {
       title: 'components',
       collapsable: false,
       children: [['text', 'Text']]
      }
   ],
   '/guide/': ['FAQ'],
   '/': ['']   // how to config to redirect '/components/' ???
}

Version

0.14.4

Steps to reproduce

What is expected?

Sidebar provides a property that supports redirect to other route

What is actually happening?

Other relevant information

  • Your OS: MacOS 10.13
  • Node.js version: 8.11.*
  • Browser version: Chrome 70+
  • Is this a global or local install? local
  • Which package manager did you use for the install? npm
@ronggang
Copy link

sidebar: {
'/components/': [
'',
['quickstart', 'Quick Start'],
['i18n', 'Internationalization'],
{
title: 'components',
collapsable: false,
children: [['text', 'Text']]
}
],
'/guide/': ['FAQ'],
'/': ['', '/components/'] // Is this what you mean?
}

@my9074
Copy link
Author

my9074 commented Oct 31, 2018

@ronggang Such a configuration cannot be achieved by jumping from the root directory to the specified url. I expect to automatically jump to the http://xxxx/vue-components-webpack4/components URL when entering the http://xxxx/vue-components-webpack4/ URL

@ronggang
Copy link

ronggang commented Nov 1, 2018

@my9074 One way, you can write scripts in README.md of the root directory's, like this:

<script>
export default {
  mounted () {
    this.$router.push('/components/')
  }
}
</script>

@my9074
Copy link
Author

my9074 commented Nov 1, 2018

@ronggang It's work. thx for your help

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