多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
~~~ {load href="/static/admin/plugins/ueditor/ueditor.config.js"/} {load href="/static/admin/plugins/ueditor/ueditor.all.min.js"/} <script> $(function() { var ue = UE.getEditor('content'), uploadEditor = UE.getEditor('upload-photo-btn'), photoListItem, uploadImage; uploadEditor.ready(function () { uploadEditor.setDisabled(); uploadEditor.hide(); uploadEditor.addListener('beforeInsertImage', function (t, arg) { $.each(arg, function (index, item) { photoListItem = '<div class="photo-list"><input type="text" name="photo[]" value="' + item.src + '" class="layui-input layui-input-inline">'; photoListItem += '<button type="button" class="layui-btn layui-btn-danger remove-photo-btn">移除</button></div>'; $('#photo-container').append(photoListItem).on('click', '.remove-photo-btn', function () { $(this).parent('.photo-list').remove(); }); }); }); }); $('#upload-photo-btn').on('click', function () { uploadImage = uploadEditor.getDialog("insertimage"); uploadImage.open(); }); }); </script> ~~~