mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 06:35:10 +00:00
18 lines
343 B
JavaScript
18 lines
343 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: '',
|
|
foo: 'bar'
|
|
}
|
|
const value = map[injectValue]
|
|
inject(key, value)
|
|
}
|