Skip to content

[Vue warn]: Invalid prop: type check failed for prop "onChange". Expected Function, got Array  #3933

@w18701660942

Description

@w18701660942
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.1.1

Environment

开发

Reproduction link

http://localhost:8090/country/country_list

Steps to reproduce

开发2次组件时,只要加chang事件就报[Vue warn]: Invalid prop: type check failed for prop "onChange". Expected Function, got Array

What is expected?

能正常使用

What is actually happening?

能正常使用


<script lang="ts"> import { useEmits, useProps } from '@/hooks' import { defineComponent, ref } from 'vue' const plainOptions = ['Apple', 'Pear', 'Orange'] export default defineComponent({ props: { ...useProps(), value: Array, }, emits: ['update:value'], setup(props, ctx) { const { emit } = ctx const change = (checkedValue: any) => { emit('update:value',checkedValue) } return { change, plainOptions, value1: ref([]) } } }) </script>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions