mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-12 00:53:55 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
17 lines
335 B
JavaScript
17 lines
335 B
JavaScript
export default ({ route, params }, inject) => {
|
|
const { injectValue } = route.query
|
|
if (typeof injectValue === 'undefined') {
|
|
return
|
|
}
|
|
const key = 'injectedProperty'
|
|
const map = {
|
|
undefined,
|
|
'null': null,
|
|
'false': false,
|
|
'0': 0,
|
|
'empty': ''
|
|
}
|
|
const value = map[injectValue]
|
|
inject(key, value)
|
|
}
|