We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前发现svg、csv会导致报错
https://github.com/code-farmer-i/vue-markdown-editor/blob/dev/src/utils/file.js
// Modified from https://github.com/ElemeFE/element/blob/dev/packages/upload/src/upload-dragger.vue export function filesFilter(files, config) { const { accept } = config; const filesKeys = Object.keys(files).filter((key) => { const file = files[key]; const { type, name } = file; // 这边file是null,导致解构报错 const extension = name.indexOf('.') > -1 ? `.${name.split('.').pop()}` : ''; const baseType = type.replace(/\/.*$/, ''); return accept .split(',') .map((type) => type.trim()) .filter((type) => type) .some((acceptedType) => { if (/\..+$/.test(acceptedType)) { return extension === acceptedType; } if (/\/\*$/.test(acceptedType)) { return baseType === acceptedType.replace(/\/\*$/, ''); } // eslint-disable-next-line no-useless-escape // eslint-disable-next-line no-useless-escape if (/^[^\/]+\/[^\/]+$/.test(acceptedType)) { return type === acceptedType; } return false; }); }); return filesKeys.map((key) => files[key]); } export function getFilesFromClipboardData(clipboardData) { return Object.keys(clipboardData.items) .filter((key) => clipboardData.items[key].kind === 'file') .map((key) => clipboardData.items[key].getAsFile()); // 这里getAsFile()返回null,导致上面报错 }
The text was updated successfully, but these errors were encountered:
测试了一下Windows Chrome,Windows好像不能粘贴
Sorry, something went wrong.
不支持粘贴svg和一部分类型,报错已在1.5.3 & 2.1.5 版本中优化。
No branches or pull requests
目前发现svg、csv会导致报错
https://github.com/code-farmer-i/vue-markdown-editor/blob/dev/src/utils/file.js
The text was updated successfully, but these errors were encountered: