支持打开图片资源管理器,选择图片插入指定元素
HTML
<el-form-item label="封面" required>
<?php think_vue_media_button('image')?>
</el-form-item>
VUE
<?php
think_vue_media($vue,"
if(!this.form.image){
this.form.image= [];
}
for(let i in dd){
if(dd[i] && dd[i].url){
this.form.image.push(dd[i].url);
}
}
","
this.selected_media_use_muit = true;
");
$vue->method("remove_images(index)","
this.form.image.splice(index,1);
this.\$forceUpdate();
");
?>
注意其中 image 变量