Skip to content

Commit bb26980

Browse files
committed
feat(plugin): add picture
1 parent 5501cc6 commit bb26980

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
const defaultPngPath = 'http://jietu-10024907.file.myqcloud.com/kblthjeuhituluuaalpiuyvfwrldpkrj.jpg'
2+
3+
export default {
4+
name: 'lbp-picture',
5+
render () {
6+
return <img src={this.imgSrc || defaultPngPath} alt="" srcset="" width="100%" />
7+
},
8+
props: {
9+
imgSrc: {
10+
type: String,
11+
default: defaultPngPath
12+
}
13+
},
14+
data: () => ({
15+
defaultPngPath
16+
}),
17+
editorConfig: {
18+
propsConfig: {
19+
imgSrc: {
20+
type: 'picture-picker',
21+
label: '',
22+
require: true,
23+
widgetProps: {
24+
value: '',
25+
template: '%i',
26+
},
27+
},
28+
},
29+
components: {
30+
// 'picture-picker': PicturePicker,
31+
}
32+
}
33+
}

front-end/h5/src/views/Editor.vue

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import Vue from 'vue'
33
import CoreEditor from '../components/core/editor'
44
55
import LbpButton from '../components/plugins/lbp-button'
6+
import LbpPicture from '../components/plugins/lbp-picture'
67
78
const PluginList = [
89
{
@@ -11,6 +12,13 @@ const PluginList = [
1112
component: LbpButton,
1213
visible: true,
1314
name: 'lbp-button'
15+
},
16+
{
17+
title: '图片',
18+
icon: 'file-image-o',
19+
component: LbpPicture,
20+
visible: true,
21+
name: 'lbp-picture'
1422
}
1523
]
1624

0 commit comments

Comments
 (0)