export default function () {
const option = {
(配置属性)name: 'vue-html5-editor',
。。。。。
(配置属性) image: {
// 文件最大体积,单位字节
sizeLimit: 512 * 1024,
// upload config,default null and convert image to base64
upload: {
url: '/url',
headers: {},
params: {
companyID: 1,
userID: 1
},
fieldName: 'file'
}
}
(配置属性)uploadHandler(responseText) {
//default accept json data like {ok:false,msg:"unexpected"} or {ok:true,data:"image url"}
var json = JSON.parse(responseText);
console.info(json);
if (json.code === 1) {
return json.data
} else {
alert(json.msg)
}
}
。。。。。
},