我在vue- test -utils中使用了玩笑,我想要上传文件的测试方法。在vue文件组件中使用此方法。
async uploadFiles(file){
this.$refs.iconUpload.setAttribute('data-load', 'loading')
let formData = new FormData();
formData.append('image', file);
try{
const result = await fetch('/upload', {
met
我有一个清单 <li v-for="menu_item, key in menu" @click="clickMenu(key)" :ref="'menu'+key">
{{menu_item.name}}
</li> 在我的vue里我有 mounted(){
// This shows the $refs as being mounted and available
console.log(this.$refs)
console.log(this.$refs.menu1)
/
我使用this.$refs.form.reset()作为我的模式,所有字段都被清除,直到我使用v-file-input字段。错误产生Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'.
如果我手动将v-file-input的值设置为null,那么一切都正常。如何在没有此错误的情况下保留使用this.$refs.form.reset()?
<v-file-input
v-model="tableItem.photo
1x代码:它正在工作。
this.$compile(this.$els.ajaxcontent);
2次移徙:
this.$compile(this.$refs.ajaxcontent);
// Error: $compile function not found.
Vue.compile(this.$refs.ajaxcontent);
// Error: template.trim not a function.
Vue.compile($('#ajaxContent').get(0));
// Error: template.trim not a function.