如何在 Nuxt3 中从 url 加载动态图像?

问题描述 投票:0回答:1
vue.js nuxt.js nuxtjs3
1个回答
0
投票

它应该被定义为计算属性,因为它取决于其他属性的值(对

name
做同样的事情):

<script setup>

  import { useAuth0 } from '@auth0/auth0-vue';
  
  let auth0 = process.client ? useAuth0() : undefined;

  const name = computed(()=>auth0?.isAuthenticated ? auth0?.user?.value.nickname:'');
  const image = computed(()=>auth0?.isAuthenticated ? auth0?.user?.value.picture:'');


</script>
© www.soinside.com 2019 - 2024. All rights reserved.