Commit e839d9c422d48265bc8a7bc5c5d6b249b8354372

Authored by ly525
1 parent 7896ce57

feat(component): 增加公告组件;

#!en: add notice-bar component
front-end/h5/src/components/plugins/lbp-notice-bar.js 0 → 100644
  1 +/*
  2 + * @Author: ly525
  3 + * @Date: 2020-05-14 08:09:44
  4 + * @LastEditors: ly525
  5 + * @LastEditTime: 2020-05-14 08:36:35
  6 + * @FilePath: /luban-h5/front-end/h5/src/components/plugins/lbp-notice-bar.js
  7 + * @Github: https://github.com/ly525/luban-h5
  8 + * @Description: Do not edit
  9 + * @Copyright 2018 - 2019 luban-h5. All Rights Reserved
  10 + */
  11 +
  12 +import commonProps from '@luban-h5/plugin-common-props'
  13 +import { NoticeBar } from 'vant'
  14 +import 'vant/lib/notice-bar/style'
  15 +
  16 +export default {
  17 + name: 'lbp-notice-bar',
  18 + props: {
  19 + text: commonProps.text({
  20 + defaultValue: '请填写内容,如果过长,将会在手机上滚动显示',
  21 + label: '公告'
  22 + }),
  23 + vertical: commonProps.vertical,
  24 + backgroundColor: commonProps.backgroundColor,
  25 + color: commonProps.color,
  26 + mode: {
  27 + type: String,
  28 + default: '',
  29 + editor: {
  30 + type: 'a-select',
  31 + label: '模式',
  32 + prop: {
  33 + options: [
  34 + {
  35 + label: '默认',
  36 + value: ''
  37 + },
  38 + {
  39 + label: '右侧有箭头',
  40 + value: 'link'
  41 + },
  42 + {
  43 + label: '可关闭',
  44 + value: 'closeable'
  45 + }
  46 + ]
  47 + }
  48 + }
  49 + }
  50 + },
  51 + componentsForPropsEditor: {
  52 + },
  53 + mounted () {
  54 + },
  55 + methods: {
  56 +
  57 + },
  58 + render () {
  59 + return <NoticeBar
  60 + mode={this.mode}
  61 + color={this.color}
  62 + left-icon="volume-o"
  63 + text={this.text}
  64 + background={this.backgroundColor}
  65 + />
  66 + }
  67 +}
front-end/h5/src/mixins/load-plugins.js
@@ -11,9 +11,21 @@ import LbpFormCheckboxGroup from &#39;../components/plugins/lbp-form-checkbox-group&#39; @@ -11,9 +11,21 @@ import LbpFormCheckboxGroup from &#39;../components/plugins/lbp-form-checkbox-group&#39;
11 import LbpBackground from '../components/plugins/lbp-background' 11 import LbpBackground from '../components/plugins/lbp-background'
12 import LbpSlide from '../components/plugins/lbp-slide' 12 import LbpSlide from '../components/plugins/lbp-slide'
13 import LbpBgMusic from '../components/plugins/lbp-bg-music' 13 import LbpBgMusic from '../components/plugins/lbp-bg-music'
  14 +import LbpNoticeBar from '../components/plugins/lbp-notice-bar'
14 15
15 export const pluginsList = [ 16 export const pluginsList = [
16 { 17 {
  18 + title: '公告',
  19 + i18nTitle: {
  20 + 'en-US': 'Notice-Bar',
  21 + 'zh-CN': '公告'
  22 + },
  23 + icon: 'volume-up',
  24 + component: LbpNoticeBar,
  25 + visible: true,
  26 + name: LbpNoticeBar.name
  27 + },
  28 + {
17 title: '图片', 29 title: '图片',
18 i18nTitle: { 30 i18nTitle: {
19 'en-US': 'Picture', 31 'en-US': 'Picture',