限制图片大小和类型

限制大小

默认限制图片大小是 5M ,可以自己修改。

editor.config.uploadImgMaxSize = 2 * 1024 * 1024 // 2M

限制类型

可自定义配置,如:

editor.config.uploadImgAccept = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp']

系统默认配置为:

['jpg', 'jpeg', 'png', 'gif', 'bmp']

如果不希望限制类型,可将其设为空数组:

editor.config.uploadImgAccept = []
Copyright © wangEditor (2020 - present) all right reserved,powered by GitbookFile Modify: 2021-04-08 13:42:57

results matching ""

    No results matching ""