screen_rotation
Copied to Clipboard
<html> <head> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script src="https://unpkg.com/axios/dist/axios.min.js"></script> </head> <body> <h3>Vue Js Get Client Ip Address</h3> <div id="app"> <p>Your IP address is: {{ ipAddress }}</p> </div> <script type="module"> const app = new Vue({ el: "#app", data() { return { ipAddress: null } }, mounted() { axios .get('https://api.ipify.org?format=json') .then(response => { this.ipAddress = response.data.ip; }) .catch(error => { console.log(error); }); } }) </script> </body> </html>