Skip to content
This repository was archived by the owner on Jan 19, 2023. It is now read-only.
This repository was archived by the owner on Jan 19, 2023. It is now read-only.

如何给组件传入函数 #6

@ACERY1

Description

@ACERY1

最开始采用的是props里将prop的数据类型改为Function,后来发现没有效果。

后来用的是:

在子组件里面定义基础事件,并使用emit/invoke/broadcast来通信,在上层组件或页面里的events内部进行捕获。

		events = {
			'input': (event) => {
				console.log('get')
			},
			'confirm': (event) => {

			}
		}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions