Skip to content

Commit

Permalink
fix(x): ios 适配 from 内置组件,不再主动注册当前数据,移除不必要的 console
Browse files Browse the repository at this point in the history
  • Loading branch information
Otto-J authored and zhetengbiji committed Mar 6, 2024
1 parent d482973 commit abd1157
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { defineBuiltInComponent } from '@dcloudio/uni-components'
import {
CHECKBOX_GROUP_NAME,
CHECKBOX_GROUP_ROOT_ELEMENT,
// UniCheckboxGroupChangeEvent,
checkboxGroupProps,
CheckboxInfo,
UniCheckboxGroupChangeEvent,
UniCheckboxGroupElement,
} from './model'
import { getCurrentInstance, onMounted, onUnmounted, ref, camelize } from 'vue'
import { $dispatch } from '../../utils'
import { getCurrentInstance, onMounted, ref, camelize } from 'vue'

export default /*#__PURE__*/ defineBuiltInComponent({
name: CHECKBOX_GROUP_NAME,
Expand Down Expand Up @@ -88,31 +86,9 @@ export default /*#__PURE__*/ defineBuiltInComponent({
? props[keyString]?.toString() ?? null
: null
}

// for form
const ctx = instance.proxy
$dispatch(
ctx,
'Form',
'formControlUpdate',
uniCheckboxGroupElementRef.value,
'add'
)
})
})

onUnmounted(() => {
// for form
const ctx = instance?.proxy
$dispatch(
ctx,
'Form',
'formControlUpdate',
uniCheckboxGroupElementRef.value,
'remove'
)
})

expose({
_checkboxGroupUpdateHandler,
_changeHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export default /*#__PURE__*/ defineBuiltInComponent({
}

const onScrollend = (e: ScrollEvent) => {
console.log('onScrollend')
if (Date.now() - data.scrollToElementTime < 200) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ export default /*#__PURE__*/ defineBuiltInComponent({
val.forEach((_val, index) => {
if (data.$items.length > index) {
const fn = data.$items[index].$.exposed?.setCurrent
// data.$items[index].$.exposed?.setCurrent?.(val)
console.log(fn, _val)
fn(_val)
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="@dcloudio/uni-app-x/types/native-global" />
import { defineBuiltInComponent } from '@dcloudio/uni-components'
import { onMounted, getCurrentInstance, ref, onUnmounted, camelize } from 'vue'
import { onMounted, getCurrentInstance, ref, camelize } from 'vue'
import {
RADIOGROUP_NAME,
RADIOGROUP_ROOT_ELEMENT,
Expand All @@ -9,7 +9,6 @@ import {
UniRadioGroupChangeEvent,
UniRadioGroupElement,
} from './model'
import { $dispatch } from '../../utils'

/**
* radio-group 组件
Expand Down Expand Up @@ -109,30 +108,9 @@ export default /*#__PURE__*/ defineBuiltInComponent({
? props[keyString]?.toString() ?? null
: null
}

// for form
const ctx = instance?.proxy
$dispatch(
ctx,
'Form',
'formControlUpdate',
uniRadioGroupElementRef.value,
'add'
)
})
})

onUnmounted(() => {
const ctx = instance?.proxy
$dispatch(
ctx,
'Form',
'formControlUpdate',
uniRadioGroupElementRef.value,
'remove'
)
})

expose({
_radioGroupUpdateHandler,
_getValue,
Expand Down

0 comments on commit abd1157

Please sign in to comment.