From 3d813db7c2526e5b536c69a109e132dde71abc91 Mon Sep 17 00:00:00 2001 From: ly525 Date: Sun, 17 May 2020 21:38:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(plugin):=20add=20rate=20componnet;=20#!zh:?= =?UTF-8?q?=20=E5=A2=9E=E5=8A=A0=E8=AF=84=E5=88=86=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../h5/src/components/plugins/lbp-rate.js | 78 +++++++++++++++++++ front-end/h5/src/mixins/load-plugins.js | 24 ++++++ 2 files changed, 102 insertions(+) create mode 100644 front-end/h5/src/components/plugins/lbp-rate.js diff --git a/front-end/h5/src/components/plugins/lbp-rate.js b/front-end/h5/src/components/plugins/lbp-rate.js new file mode 100644 index 00000000..01c59505 --- /dev/null +++ b/front-end/h5/src/components/plugins/lbp-rate.js @@ -0,0 +1,78 @@ +/* + * @Author: ly525 + * @Date: 2020-05-17 20:04:23 + * @LastEditors: ly525 + * @LastEditTime: 2020-05-17 21:33:31 + * @FilePath: /luban-h5/front-end/h5/src/components/plugins/lbp-rate.js + * @Github: https://github.com/ly525/luban-h5 + * @Description: Do not edit + * @Copyright 2018 - 2019 luban-h5. All Rights Reserved + */ +import PropTypes from '@luban-h5/plugin-common-props' +import { Rate } from 'vant' +import 'vant/lib/rate/style' +import 'vant/lib/icon/local.css' + +export default { + name: 'lbp-rate', + props: { + value: PropTypes.number({ + defaultValue: 5, + label: '当前分值' + }), + count: PropTypes.number({ + defaultValue: 5, + label: '图标总数' + }), + size: PropTypes.number({ + defaultValue: 16, + label: '图标大小' + }), + gutter: PropTypes.number({ + defaultValue: 16, + label: '图标间距' + }), + mode: { + type: String, + default: '', + editor: { + type: 'a-select', + label: '模式', + props: { + options: [ + { + label: 'star', + value: 'star' + }, + { + label: '点赞', + value: 'like' + }, + { + label: 'Good', + value: 'good-job' + } + ] + } + } + } + }, + componentsForPropsEditor: { + }, + mounted () { + }, + methods: { + + }, + render () { + return + } +} diff --git a/front-end/h5/src/mixins/load-plugins.js b/front-end/h5/src/mixins/load-plugins.js index b3d7da67..55d85e72 100644 --- a/front-end/h5/src/mixins/load-plugins.js +++ b/front-end/h5/src/mixins/load-plugins.js @@ -12,6 +12,8 @@ import LbpBackground from '../components/plugins/lbp-background' import LbpSlide from '../components/plugins/lbp-slide' import LbpBgMusic from '../components/plugins/lbp-bg-music' import LbpNoticeBar from '../components/plugins/lbp-notice-bar' +import LbpRate from '../components/plugins/lbp-rate' +// import LbpTabs from '../components/plugins/lbp-tabs' export const pluginsList = [ { @@ -25,6 +27,28 @@ export const pluginsList = [ visible: true, name: LbpNoticeBar.name }, + // { + // title: '标签页', + // i18nTitle: { + // 'en-US': 'Tabs', + // 'zh-CN': '标签页' + // }, + // icon: 'tab', + // component: LbpTabs, + // visible: true, + // name: LbpTabs.name + // }, + { + title: '评分', + i18nTitle: { + 'en-US': 'Rate', + 'zh-CN': '评分' + }, + icon: 'star-o', + component: LbpRate, + visible: true, + name: LbpRate.name + }, { title: '图片', i18nTitle: {