Commit acd59990443d5c5191e48d79f39d2864a4dfd768
1 parent
ae8eaaea
feat(plugin) support video
Showing
2 changed files
with
45 additions
and
3 deletions
front-end/h5/src/components/plugins/lbp-video.js
0 → 100644
| 1 | +export default { | |
| 2 | + name: 'lbp-video', | |
| 3 | + props: { | |
| 4 | + src: { | |
| 5 | + type: String, | |
| 6 | + default: `` | |
| 7 | + }, | |
| 8 | + disabled: { | |
| 9 | + type: Boolean, | |
| 10 | + default: false | |
| 11 | + } | |
| 12 | + }, | |
| 13 | + watch: { | |
| 14 | + src () { | |
| 15 | + this.$el.innerHTML = this.src | |
| 16 | + } | |
| 17 | + }, | |
| 18 | + mounted () { | |
| 19 | + this.$el.innerHTML = this.src | |
| 20 | + }, | |
| 21 | + | |
| 22 | + render (h) { | |
| 23 | + const style = this.disabled ? { 'pointer-events': 'none' } : {} | |
| 24 | + return ( | |
| 25 | + <div style={style}></div> | |
| 26 | + ) | |
| 27 | + }, | |
| 28 | + editorConfig: { | |
| 29 | + propsConfig: { | |
| 30 | + src: { | |
| 31 | + type: 'a-input', | |
| 32 | + label: '视频url', | |
| 33 | + prop: { | |
| 34 | + type: 'textarea' | |
| 35 | + }, | |
| 36 | + defaultPropValue: '' | |
| 37 | + } | |
| 38 | + }, | |
| 39 | + components: { | |
| 40 | + } | |
| 41 | + } | |
| 42 | +} | ... | ... |
front-end/h5/src/mixins/load-plugins.js
| 1 | 1 | import Vue from 'vue' |
| 2 | 2 | import LbpButton from '../components/plugins/lbp-button' |
| 3 | 3 | import LbpPicture from '../components/plugins/lbp-picture' |
| 4 | +import LbpVideo from '../components/plugins/lbp-video' | |
| 4 | 5 | import LbpText from '../components/plugins/lbp-text' |
| 5 | 6 | import LbpFormInput from '../components/plugins/lbp-form-input' |
| 6 | 7 | import LbpFormButton from '../components/plugins/lbp-form-button' |
| ... | ... | @@ -73,10 +74,9 @@ export const pluginsList = [ |
| 73 | 74 | }, |
| 74 | 75 | title: '视频', |
| 75 | 76 | icon: 'file-video-o', |
| 76 | - component: LbpFormRadioGroup, | |
| 77 | + component: LbpVideo, | |
| 77 | 78 | visible: true, |
| 78 | - name: LbpFormRadioGroup.name, | |
| 79 | - disabled: true | |
| 79 | + name: LbpVideo.name | |
| 80 | 80 | }, |
| 81 | 81 | // { |
| 82 | 82 | // title: '视频', | ... | ... |