{"action":"created","issue":{"url":"https://api.github.com/repos/nuxt/nuxt.js/issues/366","repository_url":"https://api.github.com/repos/nuxt/nuxt.js","labels_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/366/labels{/name}","comments_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/366/comments","events_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/366/events","html_url":"https://github.com/nuxt/nuxt.js/issues/366","id":213073123,"node_id":"MDU6SXNzdWUyMTMwNzMxMjM=","number":366,"title":"How to handle conditional rendering that involves window?","user":{"login":"f15gdsy","id":1439942,"node_id":"MDQ6VXNlcjE0Mzk5NDI=","avatar_url":"https://avatars2.githubusercontent.com/u/1439942?v=4","gravatar_id":"","url":"https://api.github.com/users/f15gdsy","html_url":"https://github.com/f15gdsy","followers_url":"https://api.github.com/users/f15gdsy/followers","following_url":"https://api.github.com/users/f15gdsy/following{/other_user}","gists_url":"https://api.github.com/users/f15gdsy/gists{/gist_id}","starred_url":"https://api.github.com/users/f15gdsy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f15gdsy/subscriptions","organizations_url":"https://api.github.com/users/f15gdsy/orgs","repos_url":"https://api.github.com/users/f15gdsy/repos","events_url":"https://api.github.com/users/f15gdsy/events{/privacy}","received_events_url":"https://api.github.com/users/f15gdsy/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-09T15:33:55Z","updated_at":"2018-11-03T03:14:21Z","closed_at":"2017-03-10T04:26:11Z","author_association":"NONE","body":"Hi, I used nuxt to render a vue template that involves v-if.\r\n\r\n```\r\n// template\r\n<header v-if=\"checkMobile()\"></header>\r\n\r\n// script\r\nexport default {\r\n  methods: {\r\n    checkMobile() {\r\n      return window ? window.innerWidth < 768 : true\r\n    }\r\n}\r\n```\r\n\r\nThis may cause different rendering result between server and client due to window.innerWidth.\r\nAnd this raises an error:\r\n```\r\nThe client-side rendered virtual DOM tree is not matching server-rendered content.\r\n```\r\n\r\nSo, how should I handle conditional rendering that involves window?\r\n\r\nThank you!\n\n<!--cmty--><!--cmty_prevent_hook-->\n<div align=\"right\"><sub><em>This question is available on <a href=\"https://nuxtjs.cmty.io\">Nuxt.js</a> community (<a href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c312\">#c312</a>)</em></sub></div>"},"comment":{"url":"https://api.github.com/repos/nuxt/nuxt.js/issues/comments/435556034","html_url":"https://github.com/nuxt/nuxt.js/issues/366#issuecomment-435556034","issue_url":"https://api.github.com/repos/nuxt/nuxt.js/issues/366","id":435556034,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTU1NjAzNA==","user":{"login":"lock[bot]","id":33595554,"node_id":"MDM6Qm90MzM1OTU1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/in/6672?v=4","gravatar_id":"","url":"https://api.github.com/users/lock%5Bbot%5D","html_url":"https://github.com/apps/lock","followers_url":"https://api.github.com/users/lock%5Bbot%5D/followers","following_url":"https://api.github.com/users/lock%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/lock%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/lock%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lock%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/lock%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/lock%5Bbot%5D/repos","events_url":"https://api.github.com/users/lock%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/lock%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-11-03T03:14:21Z","updated_at":"2018-11-03T03:14:21Z","author_association":"NONE","body":"This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.\n"}}
{"actor":{"display_login":"lock"}}