<template>
  <div>
    <div>Your Public IP: {{publicIP}}</div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      publicIP: ''
    };
  },
  created() {
    // Fetch public IP
    fetch('https://api.ipify.org?format=json')
      .then(response => response.json())
      .then(data => {
        this.publicIP = data.ip;
      });
  }
};
</script>

 

posted on 2023-03-09 23:38  鲤斌  阅读(75)  评论(0编辑  收藏  举报