feat: upgrade sidebar, remove header, upgrade search

This commit is contained in:
Justineo
2021-07-19 16:27:38 +08:00
parent a9d349aed1
commit fe6f5376a9
14 changed files with 726 additions and 632 deletions

View File

@@ -1,32 +0,0 @@
import { getLocale } from '../common/i18n'
function check (name, timeout, callback) {
if (name in window) {
setTimeout(() => callback(window[name]))
return
}
setTimeout(() => {
check(name, timeout, callback)
}, timeout)
}
export default ({ app, route }) => {
// if (process.env.NODE_ENV !== 'production') return
check('docsearch', 300, docsearch => {
window.docsearchInstance = docsearch({
apiKey: '21cdc123c620ec4bb81259c32e90c08f',
indexName: 'veui',
inputSelector: '.search',
algoliaOptions: {
facetFilters: [`lang:${getLocale(route.path)}`]
},
handleSelected (input, e, { url }) {
input.setVal('')
e.preventDefault()
let { pathname, search, hash } = new URL(url)
app.router.push(`${pathname}${search}${hash}`)
}
})
})
}

View File

@@ -1,4 +0,0 @@
import 'veui/managers/config'
import config from 'veui/managers/config'
config.set('modal.scrollLockMode', 'advanced')