vue 子传父 多个值

vue 子传父 多个值子组件子组件通过 emit 触发父组件中的自定义函数 第一个值为自定义函数名 后面的参数是向父组件传的值 van button click emitGetList type info 搜索 emitGetList this emit refreshList this cityValue this amount this requires 父组件 van button click emitGetList type info

子组件

子组件通过$emit触发父组件中的自定义函数,第一个值为自定义函数名,后面的参数是向父组件传的值

<van-button @click="emitGetList" type="info">搜索</van-button> emitGetList(){ 
    this.$emit('refreshList',this.cityValue,this.amount,this.requires); }, 

父组件

<searchChild @refreshList = 'getDate' ></searchChild> getDate(city,industry,Lstyle,amount,requires){ 
    this.cityValue = city this.industry = industry this.Lstyle = Lstyle this.amount = amount this.requires = requires this.getList() }, 
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/233834.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • springboot 事务配置

    springboot 事务配置1、全局配置@EnableTransactionManagement@Aspect@ConfigurationpublicclassGlobalTransactionConfig{//写事务的超时时间为10秒privatestaticfinalintTX_METHOD_TIMEOUT=10;//restful包下所有service包或者service的子包的任意类的任意方法privatestaticfinalStringAOP

    2022年5月17日
    51
  • [Err] 1062 – Duplicate entry ‘0’ for key ‘PRIMARY’

    [Err] 1062 – Duplicate entry ‘0’ for key ‘PRIMARY’

    2021年10月17日
    53
  • lc5找回windows账户信息

    lc5找回windows账户信息  示例:利用lc5获取winserver2003的账户信息。  1. 安装lc5。百度搜索lc5下载安装包,并将lc5安装到winserver2003虚拟机上。  2. 可以用一下命令创建几个待测试的账号    命令行:netusernamepassword/add创建用户           netusername…

    2022年7月24日
    6
  • TKmybatis的框架介绍及使用方法

    最近项目使用了SpringBoot+TKMytis框架,期间遇到一些问题,顺便记一下。一、框架配置配置的话非常简单,我用的是SpringBoot,直接引入:&lt;dependency&gt;&lt;groupId&gt;tk.mybatis&lt;/groupId&gt;&lt;artifactId&gt;mapper-spring-boot-starter&l…

    2022年4月4日
    190
  • keras+resnet34实现车牌识别

    keras+resnet34实现车牌识别1.使用PIL和opencv生成车牌图像数据fromPILimportImageFont,Image,ImageDrawimportcv2importnumpyasnpimportosfrommathimport*#创建生成车牌图像数据的类index={“京”:0,”沪”:1,”津”:2,”渝”:3,”冀”:4,”晋”:5,”蒙”:6,”辽”:7,”吉”:8,”黑”:9,”苏”:10,”浙”:11,”皖”:12,

    2022年9月28日
    0
  • SD卡与MMC卡的区别

    SD卡与MMC卡的区别本文译至:http://home.impress.co.jp/magazine/dosvpr/q-a/0108/qa0108_2.htm

    2022年6月12日
    39

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号