我已经编写了一个应该接收“uploadedFile” Prop 的 vue 组件,但它不工作。 我刚刚收到有关 $attrs 的正确信息:
我的组件:
Vue.component('table-file', {
props: ['files'],
template: '<div class="row"><table class= "table table-sm table-hover"><thead><tr><th scope="col" style="text-align: center">FILE NAME</th><th scope="col" style="text-align: center; width: 20%;" colspan="2">OPTIONS</th></tr></thead><tbody><tr v-for="(file, index) in files" :key="index" style="text-align: center;"><td scope="row" style="font-size: medium !important">{{file.FileName}}</td><td><Button class="btn btn-info btn-raised" v-on:click="downloadFile(file.ID)" style="margin: 0">Download</Button></td><td>\<Button class="btn btn-info btn-raised" v-on:click="deleteFile(file.ID)" style="margin: 0; background-color: red">Delete</Button></td></tr></tbody ></table ></div >'
})
<table-file :files="uploadedFile"></table-file>
谁能帮帮我?
最佳答案
您的文件名为 uploadedfile
而不是 uploadedFile
关于javascript - 在 vue 组件上设置 props 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65427905/