UserProfileView.vue 555 B

1234567891011121314151617181920212223242526272829
  1. <template>
  2. <div class="container user-profile">
  3. <h1>个人中心</h1>
  4. <h2>用户名: {{ user.name }}</h2>
  5. <p>邮箱: {{ user.email }}</p>
  6. <p>手机号: {{ user.phone }}</p>
  7. <button @click="editProfile">编辑资料</button>
  8. </div>
  9. </template>
  10. <script setup>
  11. import { ref } from 'vue'
  12. const user = ref({
  13. name: '张三',
  14. email: 'zhangsan@example.com',
  15. phone: '13800138000'
  16. })
  17. const editProfile = () => {
  18. // 在这里实现编辑用户资料的逻辑
  19. }
  20. </script>
  21. <style scoped>
  22. .user-profile {
  23. padding: 20px;
  24. }
  25. </style>