mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 23:52:06 +00:00
examples: Use process.server instead
This commit is contained in:
parent
3d98a8be7f
commit
70cfc7fcc9
@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
asyncData ({ isStatic, isServer }) {
|
asyncData () {
|
||||||
return {
|
return {
|
||||||
name: isStatic ? 'static' : (isServer ? 'server' : 'client')
|
name: process.static ? 'static' : (process.server ? 'server' : 'client')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
export default function (context) {
|
export default function (context) {
|
||||||
context.userAgent = context.isServer ? context.req.headers['user-agent'] : navigator.userAgent
|
context.userAgent = process.server ? context.req.headers['user-agent'] : navigator.userAgent
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user