File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<template >
22 <view >
3- <view v-if =" leftBottom||rightBottom||leftTop||rightTop" :class =" {
3+ <view v-if =" !onlyPlusButton && ( leftBottom||rightBottom||leftTop||rightTop) " :class =" {
44 'uni-fab--leftBottom': leftBottom,
55 'uni-fab--rightBottom': rightBottom,
66 'uni-fab--leftTop': leftTop,
5656 * @value horizontal 水平显示
5757 * @value vertical 垂直显示
5858 * @property {Array} content 展开菜单内容配置项
59+ * @property {Boolean} onlyPlusButton 是否只显示加号按钮
5960 * @event {Function} trigger 展开菜单点击事件,返回点击信息
6061 */
6162 export default {
8889 show: {
8990 type: Boolean ,
9091 default: false
92+ },
93+ onlyPlusButton: {
94+ type: Boolean ,
95+ default: false
9196 }
9297 },
9398 data () {
162167 },
163168 methods: {
164169 _onClick () {
170+ this .$emit (' plusClick' )
171+ if (this .onlyPlusButton ) {
172+ return
173+ }
165174 this .isShow = ! this .isShow
166175 },
167176 open () {
Original file line number Diff line number Diff line change 77 <view class="word-btn" hover-class="word-btn--hover" :hover-start-time="20" :hover-stay-time="70" @click="switchBtn('left', 'top')"><text class="word-btn-white">左上角显示</text></view>
88 <view class="word-btn" hover-class="word-btn--hover" :hover-start-time="20" :hover-stay-time="70" @click="switchBtn('right', 'top')"><text class="word-btn-white">右上角显示</text></view>
99 </view>
10- <uni-fab ref="fab" :pattern="pattern" :content="content" :horizontal="horizontal" :vertical="vertical" :direction="direction" @trigger="trigger" />
10+ <uni-fab ref="fab" :pattern="pattern" :content="content" :horizontal="horizontal" :vertical="vertical" :direction="direction" @trigger="trigger" @plusClick="plusClick" />
1111 </view>
1212</template>
1313
7474 }
7575 })
7676 },
77+ plusClick() {
78+ uni.showToast({
79+ title: '点击了加号按钮',
80+ icon: 'none'
81+ })
82+ },
7783 switchBtn(hor, ver) {
7884 if (hor === 0) {
7985 this.direction = this.direction === 'horizontal' ? 'vertical' : 'horizontal'
You can’t perform that action at this time.
0 commit comments