Open u-sho opened 5 years ago
This is my Nuxt.js code to check params.
<template>
<mavon-editor
ref="md"
v-model="markdownText"
@imgAdd="addImage"
@imgDel="deleteImage"
/>
</template>
<script>
import 'mavon-editor/dist/css/index.css'
export default {
data() {
return {
markdownText: '',
imageFiles: []
}
},
methods: {
addImage(filename, file) {
this.imageFiles[filename] = file
},
deleteImage(filename) {
console.log(filename) // check this param
delete this.imageFiles[filename]
}
}
}
</script>
and here is one of the results
(2) [1, File, __ob__: Observer]
0: 1
1: File {miniurl: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD…lnjvFL/8AHKhuP2gvEEkmW0/SWOMcwyf/AByq5GDeuh//2Q==", _name: "u_sho.jpeg", name: "u_sho.jpeg", lastModified: 1549678985750, lastModifiedDate: Sat Feb 09 2019 11:23:05 GMT+0900 (日本標準時), …}
length: 2
__ob__: Observer {value: Array(2), dep: Dep, vmCount: 0}
__proto__: Array
Thanks to this npm package, my work is going successful.
I pray for further improvement of this repository 😸
Issue
There is a difference between documents and actual implementation of
$imgDel
function.Detail
I checked the params of
$imgDel(params)
withconsole.log(params)
.Documents says that the imgDel function is given
String: filename
. However, the params was an array like this.So, it is needed to fix document or to change implementation.
To Resolve
Target File
Samples
README
upload-image