提交 e8fce934 作者: 方治民

feat: 更新 firstui v1.9.1

上级 59ded22f
import GCanvas from './env/canvas'; import GCanvas from './env/canvas';
import GImage from './env/image'; import GImage from './env/image';
import GWebGLRenderingContext from './context-webgl/RenderingContext'; import GWebGLRenderingContext from './context-webgl/RenderingContext';// 2021-5-6变更
import GContext2D from './context-2d/RenderingContext'; import GContext2D from './context-2d/RenderingContext';
import GBridgeWeex from './bridge/bridge-weex'; import GBridgeWeex from './bridge/bridge-weex';
...@@ -12,12 +12,12 @@ export let WeexBridge = GBridgeWeex; ...@@ -12,12 +12,12 @@ export let WeexBridge = GBridgeWeex;
export function enable(el, { export function enable(el, {
bridge, bridge,
debug, debug,// 2021-5-6变更
disableAutoSwap, disableAutoSwap,
disableComboCommands disableComboCommands
} = {}) { } = {}) {
const GBridge = GImage.GBridge = GCanvas.GBridge = GWebGLRenderingContext.GBridge = GContext2D.GBridge = bridge; const GBridge = GImage.GBridge = GCanvas.GBridge = GWebGLRenderingContext.GBridge = GContext2D.GBridge = bridge;// 功能需要优化
GBridge.callEnable(el.ref, [ GBridge.callEnable(el.ref, [
0, // renderMode: 0--RENDERMODE_WHEN_DIRTY, 1--RENDERMODE_CONTINUOUSLY 0, // renderMode: 0--RENDERMODE_WHEN_DIRTY, 1--RENDERMODE_CONTINUOUSLY
...@@ -29,7 +29,7 @@ export function enable(el, { ...@@ -29,7 +29,7 @@ export function enable(el, {
false // sameLevel: newCanvasMode = true && true => GCanvasView and Webview is same level false // sameLevel: newCanvasMode = true && true => GCanvasView and Webview is same level
]); ]);
if (debug === true) { if (debug === true) {// echo建议
GBridge.callEnableDebug(); GBridge.callEnableDebug();
} }
if (disableComboCommands) { if (disableComboCommands) {
...@@ -41,7 +41,7 @@ export function enable(el, { ...@@ -41,7 +41,7 @@ export function enable(el, {
}); });
let pixelRatio = uni.getSystemInfoSync().pixelRatio; let pixelRatio = uni.getSystemInfoSync().pixelRatio;
canvas.width = el.style.width * pixelRatio; canvas.width = el.style.width * pixelRatio;
canvas.height = el.style.height * pixelRatio; canvas.height = el.style.height * pixelRatio;// 新特性待增加
return canvas; return canvas;
}; };
...@@ -159,11 +159,11 @@ ...@@ -159,11 +159,11 @@
styl += `width:${this.width}rpx;` styl += `width:${this.width}rpx;`
} }
if (this.position === 'fixed') { if (this.position === 'fixed') {
let tb = this.top ? `top:${this.top}rpx;` : ''; let tb = Number(this.top) ? `top:${this.top}rpx;` : '';
tb += this.bottom ? `bottom:${this.bottom}rpx;` : ''; tb += Number(this.bottom) ? `bottom:${this.bottom}rpx;` : '';
styl += tb ? tb : `top:${this.top}rpx;` styl += tb ? tb : `top:${this.top}rpx;`
let lr = this.left ? `left:${this.left}rpx;` : ''; let lr = Number(this.left) ? `left:${this.left}rpx;` : '';
lr += this.right ? `right:${this.right}rpx;` : ''; lr += Number(this.right) ? `right:${this.right}rpx;` : '';
styl += lr ? lr : `left:${this.left}rpx;`; styl += lr ? lr : `left:${this.left}rpx;`;
} else { } else {
// #ifdef APP-NVUE // #ifdef APP-NVUE
...@@ -184,6 +184,13 @@ ...@@ -184,6 +184,13 @@
break; break;
} }
// #endif // #endif
let tb = Number(this.top) ? `margin-top:${this.top}rpx;` : '';
tb += Number(this.bottom) ? `margin-top:-${this.bottom}rpx;` : '';
styl += tb ? tb : `margin-top:${this.top}rpx;`
let lr = Number(this.left) ? `margin-left:${this.left}rpx;` : '';
lr += Number(this.right) ? `margin-left:-${this.right}rpx;` : '';
styl += lr ? lr : `margin-left:${this.left}rpx;`;
} }
return styl return styl
}, },
...@@ -320,6 +327,9 @@ ...@@ -320,6 +327,9 @@
/* #ifdef APP-NVUE */ /* #ifdef APP-NVUE */
transition: opacity 0.3s ease-in-out; transition: opacity 0.3s ease-in-out;
/* #endif */ /* #endif */
/* margin-top: -120rpx; */
/* margin-left: 20rpx; */
} }
......
...@@ -203,9 +203,8 @@ ...@@ -203,9 +203,8 @@
let iphonex = false; let iphonex = false;
let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax', let models = ['iphonex', 'iphonexr', 'iphonexsmax', 'iphone11', 'iphone11pro', 'iphone11promax',
'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini', 'iphone12', 'iphone12mini', 'iphone12pro', 'iphone12promax', 'iphone13', 'iphone13mini',
'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini', 'iphone14plus', 'iphone13pro', 'iphone13promax', 'iphone14', 'iphone14mini',
'iphone14pro', 'iphone14promax', 'iphone15', 'iphone15mini', 'iphone15plus', 'iphone14pro', 'iphone14promax'
'iphone15pro', 'iphone15promax'
] ]
const model = res.model.replace(/\s/g, "").toLowerCase() const model = res.model.replace(/\s/g, "").toLowerCase()
const newModel = model.split('<')[0] const newModel = model.split('<')[0]
......
...@@ -5,22 +5,24 @@ ...@@ -5,22 +5,24 @@
:class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']"> :class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-VUE || MP-WEIXIN || H5 --> <!-- #ifdef APP-VUE || MP-WEIXIN || H5 -->
<view class="fui-drag__wrap" :class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag" <!-- #ifdef VUE2 -->
:id="elId" :style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list" <view class="fui-drag__wrap" :catch:touchmove="wxDrag?handler.stopTouchMove:''"
:class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag" :id="elId"
:style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list"
:change:list="handler.listChange" :param="param" :change:param="handler.paramChange"> :change:list="handler.listChange" :param="param" :change:param="handler.paramChange">
<!-- #ifndef MP-WEIXIN --> <!-- #endif -->
<view class="fui-drag-item__wrap" :style="{width:cellWidth+'px',height:cellHeight+'px'}" <!-- #ifdef VUE3 -->
v-for="(item, index) in list" :key="item.id" :data-index="index" @longpress="handler.longPress" <!-- vue3下编译到小程序data数据与wxs混用中无法获取 $data数据无法直接应用到页面,uni-app官方编译bug-->
:data-param="param" :data-isdrag="isDrag && dragging?1:0" @touchstart="handler.touchStart" <view class="fui-drag__wrap" :catch:touchmove="wxDrag?true:''"
@touchmove="handler.touchMove" @touchend="handler.touchEnd" @mousedown="handler.mousedown" :class="[dragging?'fui-drag-item__show':'fui-drag-item__hidden']" ref="fui_drag" :id="elId"
@tap="itemClick(index)"> :style="{width:wrapWidth+'px',height:(rows * cellHeight)+'px'}" :list="list"
:change:list="handler.listChange" :param="param" :change:param="handler.paramChange">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN -->
<view class="fui-drag-item__wrap" :style="{width:cellWidth+'px',height:cellHeight+'px'}" <view class="fui-drag-item__wrap" :style="{width:cellWidth+'px',height:cellHeight+'px'}"
v-for="(item, index) in list" :key="item.id" :data-index="index" @longpress="handler.longPress" v-for="(item, index) in list" :key="item.id" :data-index="index" @longpress="handler.longPress"
:data-param="param" :data-isdrag="isDrag && dragging?1:0" @touchstart="handler.touchStart" :data-param="param" :data-isdrag="isDrag && dragging?1:0" @touchstart="handler.touchStart"
:catch:touchmove="wxDrag?handler.touchMove:''" @touchend="handler.touchEnd" @tap="itemClick(index)"> @touchmove="handler.touchMove" @touchend="handler.touchEnd" @mousedown="handler.mousedown"
<!-- #endif --> @tap="itemClick(index)">
<template v-if="custom"> <template v-if="custom">
<slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot> <slot :model="item.entity" :width="cellWidth" :height="cellHeight" :index="index"></slot>
</template> </template>
......
...@@ -273,6 +273,10 @@ function mousedown(e, ins) { ...@@ -273,6 +273,10 @@ function mousedown(e, ins) {
} }
function stopTouchMove(e) {
return true
}
module.exports = { module.exports = {
longPress: longPress, longPress: longPress,
touchStart: touchStart, touchStart: touchStart,
...@@ -280,5 +284,6 @@ module.exports = { ...@@ -280,5 +284,6 @@ module.exports = {
touchEnd: touchEnd, touchEnd: touchEnd,
paramChange: paramChange, paramChange: paramChange,
listChange: listChange, listChange: listChange,
mousedown: mousedown mousedown: mousedown,
stopTouchMove:stopTouchMove
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
:style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,background:background,marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx',borderRadius:radius}" :style="{paddingTop:padding[0] || 0,paddingRight:padding[1] || 0,paddingBottom:padding[2] || padding[0] || 0,paddingLeft:padding[3] || padding[1] || 0,background:background,marginTop:marginTop+'rpx',marginBottom:marginBottom+'rpx',borderRadius:radius}"
@tap="handleClick"> @tap="handleClick">
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<view class="fui-form__asterisk" v-if="asterisk"> <view class="fui-form__asterisk" :style="{left:getAkPosi}" v-if="asterisk">
<text :style="{color:asteriskColor || akColor || '#FF2B2B'}">*</text> <text :style="{color:asteriskColor || akColor || '#FF2B2B'}">*</text>
</view> </view>
<!-- #endif --> <!-- #endif -->
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
return `${this.labelWidth || this.lWidth || labelWidth}rpx` return `${this.labelWidth || this.lWidth || labelWidth}rpx`
}, },
getLabelRight() { getLabelRight() {
const labelRight = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.labelRight) || 16 const labelRight = (uni.$fui && uni.$fui.fuiFormItem && uni.$fui.fuiFormItem.labelRight) || 30
return `${this.labelRight || labelRight}rpx` return `${this.labelRight || labelRight}rpx`
}, },
getLabelAlign() { getLabelAlign() {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<script> <script>
export default { export default {
name: "fui-grid-item", name: "fui-grid-item",
emits: ['click'],
inject: ['grid'], inject: ['grid'],
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
options: { options: {
...@@ -79,11 +80,13 @@ ...@@ -79,11 +80,13 @@
} }
}, },
handleClick() { handleClick() {
this.grid.handleClick({ const e = {
detail: { detail: {
index: this.index index: this.index
} }
}) }
this.grid && this.grid.handleClick(e)
this.$emit('click', e)
} }
} }
} }
......
...@@ -307,6 +307,13 @@ ...@@ -307,6 +307,13 @@
font-weight: 500; font-weight: 500;
} }
/* #ifdef H5 */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
-webkit-appearance: none;
}
/* #endif */
.fui-number__disabled { .fui-number__disabled {
opacity: 0.6; opacity: 0.6;
} }
......
...@@ -64,7 +64,7 @@ export default [{ ...@@ -64,7 +64,7 @@ export default [{
cn: '晋', cn: '晋',
en: 'P' en: 'P'
}] }]
}, { }, {// echo建议
id: 'f_p3', id: 'f_p3',
keys: [{ keys: [{
cn: '蒙', cn: '蒙',
...@@ -82,7 +82,7 @@ export default [{ ...@@ -82,7 +82,7 @@ export default [{
cn: '贵', cn: '贵',
en: 'G' en: 'G'
}, { }, {
cn: '粤', cn: '粤',// 功能需要优化
en: 'H' en: 'H'
}, { }, {
cn: '青', cn: '青',
...@@ -97,10 +97,10 @@ export default [{ ...@@ -97,10 +97,10 @@ export default [{
cn: '宁', cn: '宁',
en: '' en: ''
}] }]
}, { }, {// 新特性待增加
id: 'f_p4', id: 'f_p4',
keys: [{ keys: [{
cn: 'ABC', cn: 'ABC',// echo建议
en: '返回' en: '返回'
}, { }, {
cn: '琼', cn: '琼',
...@@ -119,7 +119,7 @@ export default [{ ...@@ -119,7 +119,7 @@ export default [{
en: 'B' en: 'B'
}, { }, {
cn: '港', cn: '港',
en: 'N' en: 'N'// 新特性待增加
}, { }, {
cn: '澳', cn: '澳',
en: 'M' en: 'M'
......
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<view class="fui-modal__button" <view class="fui-modal__button"
:class="{'fui-modal__button-col':direction==='column' && index!==vals.length-1,'fui-modal__button-bg':!entity.plain && !entity.background,'fui-modal__button-border':entity.plain,'fui-modal__button-bc':entity.plain && !entity.background}" :class="{'fui-modal__button-col':direction==='column' && index!==vals.length-1,'fui-modal__button-bg':!entity.plain && !entity.background,'fui-modal__button-border':entity.plain,'fui-modal__button-bc':entity.plain && !entity.background}"
:style="{borderRadius:radius+'rpx',background:entity.plain?'transparent':(entity.background || '#465CFF'),borderColor:entity.plain?(entity.background || '#465CFF'):'transparent'}" :style="{borderRadius:radius+'rpx',background:entity.plain?'transparent':(entity.background || '#465CFF'),borderColor:entity.plain?(entity.background || '#465CFF'):'transparent'}"
v-for="(entity,index) in vals" :key="index" @tap.stop="handleClick($event,index)"> v-for="(entity,index) in vals" :key="index">
<text class="fui-modal__button-inner" <text class="fui-modal__button-inner"
:class="{'fui-modal__button-color': !entity.color && entity.plain}" :class="{'fui-modal__button-color': !entity.color && entity.plain}"
:style="{color:entity.color || (entity.plain?'#465CFF':'#fff')}">{{entity.text}}</text> :style="{color:entity.color || (entity.plain?'#465CFF':'#fff'),borderRadius:radius+'rpx'}" @tap.stop="handleClick($event,index)">{{entity.text}}</text>
</view> </view>
</view> </view>
</view> </view>
...@@ -338,6 +338,9 @@ ...@@ -338,6 +338,9 @@
border-width: 1rpx; border-width: 1rpx;
transform: translateZ(0); transform: translateZ(0);
/* #endif */ /* #endif */
/* #ifdef H5 */
border-width: 1px;
/* #endif */
border-style: solid; border-style: solid;
} }
......
...@@ -34,9 +34,10 @@ ...@@ -34,9 +34,10 @@
<view class="fui-select__flex"> <view class="fui-select__flex">
<view class="fui-select__icon-box" <view class="fui-select__icon-box"
:class="{'fui-select__icon-ml':!isReverse && type==='select','fui-select__icon-mr':isReverse}" :class="{'fui-select__icon-ml':!isReverse && type==='select','fui-select__icon-mr':isReverse}"
:style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}" v-if="model.src"> :style="{width:iconWidth+'rpx',height:iconWidth+'rpx',backgroundColor:iconBgColor}"
v-if="model.src">
<image :src="model.src" :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}" <image :src="model.src" :style="{width:iconWidth+'rpx',height:iconWidth+'rpx'}"
mode="widthFix"></image> :mode="iconMode"></image>
</view> </view>
<text class="fui-select__item-text" <text class="fui-select__item-text"
:class="{'fui-select__text-pl':!isReverse && (type==='select' || model.src),'fui-select__text-pr':isReverse && (type==='select' || model.src)}" :class="{'fui-select__text-pl':!isReverse && (type==='select' || model.src),'fui-select__text-pr':isReverse && (type==='select' || model.src)}"
...@@ -181,6 +182,14 @@ ...@@ -181,6 +182,14 @@
type: [Number, String], type: [Number, String],
default: 48 default: 48
}, },
iconBgColor: {
type: String,
default: 'rgba(0,0,0,0)'
},
iconMode: {
type: String,
default: 'widthFix'
},
size: { size: {
type: [Number, String], type: [Number, String],
default: 30 default: 30
...@@ -484,7 +493,9 @@ ...@@ -484,7 +493,9 @@
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
width: 100%; width: 100%;
/* #endif */ /* #endif */
flex: 1; /* #ifdef APP-NVUE */
width: 750rpx;
/* #endif */
} }
.fui-select__list { .fui-select__list {
...@@ -600,10 +611,12 @@ ...@@ -600,10 +611,12 @@
.fui-select__icon-box { .fui-select__icon-box {
overflow: hidden; overflow: hidden;
background-color: #F1F4FA;
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
flex-shrink: 0; flex-shrink: 0;
display: flex;
/* #endif */ /* #endif */
align-items: center;
justify-content: center;
} }
.fui-select__icon-ml { .fui-select__icon-ml {
...@@ -619,13 +632,14 @@ ...@@ -619,13 +632,14 @@
width: 100%; width: 100%;
display: flex; display: flex;
/* #endif */ /* #endif */
flex: 1; /* #ifdef APP-NVUE */
width: 750rpx;
/* #endif */
height: 98rpx; height: 98rpx;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
} }
.fui-select__header-line { .fui-select__header-line {
......
...@@ -9,7 +9,7 @@ export default { ...@@ -9,7 +9,7 @@ export default {
}, },
watch: { watch: {
show(newVal) { show(newVal) {
// if (this.autoClose) return if (this.autoClose) return
if (this.stop) return if (this.stop) return
this.stop = true this.stop = true
if (newVal) { if (newVal) {
...@@ -55,6 +55,7 @@ export default { ...@@ -55,6 +55,7 @@ export default {
}) })
}, },
touchstart(e) { touchstart(e) {
if (this.disabled) return
// 每次只触发一次,避免多次监听造成闪烁 // 每次只触发一次,避免多次监听造成闪烁
if (this.stop) return if (this.stop) return
this.stop = true this.stop = true
...@@ -62,7 +63,7 @@ export default { ...@@ -62,7 +63,7 @@ export default {
this.group.closeAuto(this) this.group.closeAuto(this)
} }
const rightWidth = this.button.right.width const rightWidth = this.button.right.width || 0
let expression = this.range(this.x, -rightWidth, 0) let expression = this.range(this.x, -rightWidth, 0)
let rightExpression = this.range(this.x + rightWidth, 0, rightWidth) let rightExpression = this.range(this.x + rightWidth, 0, rightWidth)
...@@ -93,7 +94,7 @@ export default { ...@@ -93,7 +94,7 @@ export default {
}, },
bindTiming(x) { bindTiming(x) {
const left = this.x const left = this.x
const rightWidth = this.button.right.width const rightWidth = this.button.right.width || 0
const threshold = Number(this.threshold) const threshold = Number(this.threshold)
if (!this.isopen) { if (!this.isopen) {
if (left < -threshold) { if (left < -threshold) {
...@@ -102,7 +103,7 @@ export default { ...@@ -102,7 +103,7 @@ export default {
this.open(false) this.open(false)
} }
} else { } else {
if ((x < threshold && x > 0) || (x + leftWidth < -threshold)) { if ((x < threshold && x > 0) || (x < -threshold)) {
this.open(true) this.open(true)
} else { } else {
this.open(false) this.open(false)
...@@ -120,7 +121,7 @@ export default { ...@@ -120,7 +121,7 @@ export default {
}, },
animation(type) { animation(type) {
const time = 300 const time = 300
const rightWidth = this.button.right.width const rightWidth = this.button.right.width || 0
if (this.eventpan && this.eventpan.token) { if (this.eventpan && this.eventpan.token) {
BindingX.unbind({ BindingX.unbind({
token: this.eventpan.token, token: this.eventpan.token,
......
...@@ -24,7 +24,11 @@ function getDom(ins, ownerInstance) { ...@@ -24,7 +24,11 @@ function getDom(ins, ownerInstance) {
return; return;
} }
if (isH5 || isPC()) { if (isH5 || isPC()) {
state.rightWidth = rightDom['$el'].offsetWidth || 0 if (rightDom['$el']) {
state.rightWidth = rightDom['$el'].offsetWidth || 0
} else {
state.rightWidth = 0
}
} else { } else {
var rightStyles = rightDom.getBoundingClientRect() var rightStyles = rightDom.getBoundingClientRect()
state.rightWidth = rightStyles.width || 0 state.rightWidth = rightStyles.width || 0
......
...@@ -25,9 +25,13 @@ export default { ...@@ -25,9 +25,13 @@ export default {
} }
}, },
mounted() { mounted() {
this.isShow = this.show this.$nextTick(() => {
this.isDisabled = this.disabled setTimeout(() => {
this.thresholdVal = Number(this.threshold) this.isShow = this.show
this.isDisabled = this.disabled
this.thresholdVal = Number(this.threshold)
}, 10)
})
}, },
methods: { methods: {
closeSwipe(e) { closeSwipe(e) {
...@@ -37,7 +41,7 @@ export default { ...@@ -37,7 +41,7 @@ export default {
change(e) { change(e) {
this.$emit('change', { this.$emit('change', {
isOpen: e.open === 'right', isOpen: e.open === 'right',
param:this.param param: this.param
}) })
if (this.isShow !== e.open) { if (this.isShow !== e.open) {
this.isShow = e.open this.isShow = e.open
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<view class="fui-switch__input-def" :style="{background:val?color:'#dfdfdf',borderColor:val?color:borderColor}" <view class="fui-switch__input-def" :style="{background:val?color:'#dfdfdf',borderColor:val?color:borderColor}"
:class="{'fui-switch__input--checked':val,'fui-checkbox__disabled':disabled,'fui-switch__color':val && !color}" :class="{'fui-switch__input--checked':val,'fui-checkbox__disabled':disabled,'fui-switch__color':val && !color}"
v-if="type==='switch'"> v-if="type==='switch'">
<switch class="fui-switch__hidden" @change="change" :name="name" :checked="val" :disabled="disabled" <switch class="fui-switch__hidden" :class="{'fui-pointer__events':isLabel}" @change="change" :name="name" :checked="val" :disabled="disabled"
:color="color"> :color="color">
</switch> </switch>
</view> </view>
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
:style="{background:val?color:'#fff',border:val?`1px solid ${color}`:`1px solid ${borderColor}`}" v-else> :style="{background:val?color:'#fff',border:val?`1px solid ${color}`:`1px solid ${borderColor}`}" v-else>
<view class="fui-check__mark" :style="{borderBottomColor:checkMarkColor,borderRightColor:checkMarkColor}" <view class="fui-check__mark" :style="{borderBottomColor:checkMarkColor,borderRightColor:checkMarkColor}"
v-if="val"></view> v-if="val"></view>
<switch class="fui-switch__hidden" style="opacity: 0;position: absolute;" @change="change" :name="name" :type="isNvue?'switch':'checkbox'" <switch class="fui-switch__hidden" :class="{'fui-pointer__events':isLabel}"
style="opacity: 0;position: absolute;" @change="change" :name="name" :type="isNvue?'switch':'checkbox'"
:checked="val" :disabled="disabled"></switch> :checked="val" :disabled="disabled"></switch>
</view> </view>
</view> </view>
...@@ -87,7 +88,8 @@ ...@@ -87,7 +88,8 @@
// #endif // #endif
return { return {
val: false, val: false,
isNvue: isNvue isNvue: isNvue,
isLabel: false
}; };
}, },
watch: { watch: {
...@@ -99,6 +101,7 @@ ...@@ -99,6 +101,7 @@
this.val = this.checked; this.val = this.checked;
this.label = this.getParent(); this.label = this.getParent();
if (this.label) { if (this.label) {
this.isLabel = true
this.label.childrens.push(this) this.label.childrens.push(this)
} }
}, },
...@@ -273,6 +276,13 @@ ...@@ -273,6 +276,13 @@
/* #endif */ /* #endif */
} }
/* #ifdef H5 */
.fui-pointer__events {
pointer-events: none;
}
/* #endif */
.fui-checkbox__disabled { .fui-checkbox__disabled {
opacity: 0.6; opacity: 0.6;
} }
......
...@@ -482,6 +482,7 @@ ...@@ -482,6 +482,7 @@
.fui-tabs__line-center { .fui-tabs__line-center {
justify-content: center; justify-content: center;
left: 0;
} }
.fui-tabs__ac-line { .fui-tabs__ac-line {
...@@ -492,10 +493,6 @@ ...@@ -492,10 +493,6 @@
width: 45rpx !important; width: 45rpx !important;
} }
.fui-tabs__line-center {
left: 0;
}
/* #ifndef APP-NVUE */ /* #ifndef APP-NVUE */
.fui-tabs__selected-color { .fui-tabs__selected-color {
color: var(--fui-color-primary, #465CFF) !important; color: var(--fui-color-primary, #465CFF) !important;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论