当我使用时:checked,它起作用了。但是如果我添加v-model,它不起作用。
<div v-for="answer in the_data[current].answers" id="answers">
<p>
<input
type="radio"
name="answer"
:id="answer"
:value="answer"
v-model="the_answer"
v-bind:checked="answer == 'girl'"
>
@{{ answer }}
</p>
</div>
Run Code Online (Sandbox Code Playgroud)
我需要使用 v-model
我在 vue.js 中使用 vuetify,我尝试在上传前预览图像
HTML
<v-file-input
v-on:change="Preview_image($event)"
></v-file-input>
<img id="Preview_image_create" class="Preview_image">
Run Code Online (Sandbox Code Playgroud)
Vue.js 代码
methods: {
Preview_image(e)
{
console.log(e);
if (e.target.files && e.target.files[0])
{
}
},
Run Code Online (Sandbox Code Playgroud)
选择图像时会出错
无法读取未定义的属性“文件””
日志记录e给出:
File {name: "148200_4580089360895_1364944205_n.jpg", lastModified: 1374722747086, lastModifiedDate: Thu Jul 25 2013 05:25:47 GMT+0200 (Eastern European Standard Time), webkitRelativePath: "", size: 8506, …}
lastModified: 1374722747086
lastModifiedDate: Thu Jul 25 2013 05:25:47 GMT+0200 (Eastern European Standard Time) {}
name: "148200_4580089360895_1364944205_n.jpg"
size: 8506
type: "image/jpeg"
webkitRelativePath: ""
__proto__: File
Run Code Online (Sandbox Code Playgroud)
那么如何预览图像呢?