Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(ui/collapse): add call #369

Merged
merged 2 commits into from
Apr 3, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
perf(ui/collapse): add call
  • Loading branch information
ahqrt committed Apr 3, 2022
commit 46cc2af7c09e5dd9e252af1592b3be0b97c179f2
6 changes: 3 additions & 3 deletions packages/varlet-ui/src/collapse/Collapse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import type { ComputedRef } from 'vue'
import type { CollapseItemProvider } from '../collapse-item/provide'
import type { CollapseProvider } from './provide'
import type { CollapseModelValue } from './props'
import { call } from '../utils/components'

export default defineComponent({
name: 'VarCollapse',
Expand Down Expand Up @@ -49,9 +50,8 @@ export default defineComponent({

const updateItem = (value: number | string, isExpand: boolean) => {
const modelValue = getValue(value, isExpand)

props['onUpdate:modelValue']?.(modelValue)
props.onChange?.(modelValue)
call(props['onUpdate:modelValue'], modelValue)
call(props.onChange, modelValue)
}

const matchName = (): Array<CollapseItemProvider> | CollapseItemProvider | undefined => {
Expand Down