fix: 修复actionSheet组件api.watchVisible空指针问题和去掉tabs空白padding (#278)

* 修复actionSheet在手机上click无效问题

* 修复pullRefresh组件,数据类型不匹配,导致控制台告警日志超大量打印,导致页面渲染慢的问题

* 修复actionSheet组件api.watchVisible空指针问题和去掉tabs空白padding
This commit is contained in:
MrWang2016 2023-06-10 15:56:52 +08:00 committed by GitHub
parent ae97ad85e0
commit dff7e83e0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 17 deletions

View File

@ -37,7 +37,7 @@ export const setSheetStyle = ({ state, props }) => () => {
export const initScrollMenu = ({ state, nextTick, refs, BScroll }) => () => {
nextTick(() => {
const { scrollMenu } = refs
if (state.scroll) {
if (!state.scroll) {
state.scroll = new BScroll(scrollMenu, {
probeType: 3,
tap: 'tap'

View File

@ -12,7 +12,7 @@
import { setSheetStyle, initScrollMenu, visibleHandle, watchVisible, menuHandle, close, selectOption, confirm, actionSelectOption, hide } from './index'
export const api = ['state', 'setSheetStyle', 'initScrollMenu', 'visibleHandle', 'menuHandle', 'close', 'selectOption', 'confirm', 'actionSelectOption', 'hide']
export const api = ['state', 'setSheetStyle', 'initScrollMenu', 'visibleHandle', 'watchVisible', 'menuHandle', 'close', 'selectOption', 'confirm', 'actionSelectOption', 'hide']
export const renderless = (props, { reactive, watch }, { emit, nextTick, refs, vm }, { BScroll }) => {
const api = {}
@ -24,18 +24,6 @@ export const renderless = (props, { reactive, watch }, { emit, nextTick, refs, v
scroll: null,
})
watch(() => props.visible,
(value) => {
if (value) {
api.setSheetStyle({ state, props })
api.initScrollMenu({ state, nextTick, refs, BScroll })
}
api.watchVisible(value)
},
)
watch(() => props.visible, api.watchVisible, { immediate: true })
Object.assign(api, {
state,
setSheetStyle: setSheetStyle({ state, props }),
@ -50,5 +38,17 @@ export const renderless = (props, { reactive, watch }, { emit, nextTick, refs, v
hide: hide(emit)
})
watch(() => props.visible,
(value) => {
if (value) {
api.setSheetStyle({ state, props })
api.initScrollMenu({ state, nextTick, refs, BScroll })
}
api.watchVisible(value)
},
)
watch(() => props.visible, api.watchVisible, { immediate: true })
return api
}

View File

@ -31,7 +31,6 @@
font-size: var(--ti-mobile-tabs-font-size, 14px);
color: var(--ti-mobile-tabs-text-color, #333);
background: var(--ti-mobile-tabs-bg-color, #fff);
padding: 15px 24px;
}
&__new-tab {

View File

@ -79,10 +79,12 @@ export default defineComponent({
default: false
},
pullUp: {
type: Object
type: Object,
default: {}
},
pullDown: {
type: Object
type: Object,
default: {}
},
hasMore: {
type: Boolean,