【发布时间】:2019-12-28 15:01:17
【问题描述】:
我想要做的是在页面上显示图像。我已将其路径存储在后端(MySQL)中,并在获取后将其放入 <v-img> 的 src 中,但发生错误时说-
[Vuetify] Image load failed
src: userImage
found in
---> <VImg>
<Anonymous>
<VContent>
<VApp>
<App> at src/App.vue
<Root>
编辑 - 这是我的 Profile.js 文件
<template>
<v-container >
<div class="headline">Your Profile</div>
<br><br>
<div class="title">Username-</div>
<v-text-field
v-model="user.username"
placeholder="Username"
required
></v-text-field>
<div class="title">Password-</div>
<v-text-field
v-model="user.password"
placeholder="Password"
required
></v-text-field>
<div class="title">Avatar-</div>
<v-img
v-bind:src="userImage"
aspect-ratio="1"
class="grey lighten-2"
max-width="150"
max-height="150"
></v-img>
<div class="title">Email-</div>
<v-text-field
v-model="user.email"
placeholder="Email"
required
></v-text-field>
</v-container>
</template>
【问题讨论】:
-
你需要显示一些代码,而不仅仅是错误信息......
-
对不起..
-
数据呢?
userImage的值是多少? -
userImage 的值为=
uploaded_images\users\main-thumb-394688203-200-tbjppbxdlfloldogbcqrvmrkwoxgnpom.jpeg -
我们说的就是这个DEV环境吗?这张图片在服务器上吗?
标签: vue.js vuejs2 vue-component vuex vuetify.js