You can use vm.$isServer
method to know whether the current Vue instance is running on the server or client.
The usage would be as below:
1 2 3 4 5 | const Vue = require('vue'); Vue.prototype.$isServer (OR) this.$isServer // With in component |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.