通过ref去接收值!!!

需求图片

代码实现

 //----------父组件
<div class="fingerprint-bottom">
<el-tabs v-model="activeName">
<el-tab-pane v-for="(item,index) in optionS" :key="index" :label="item.label" :name="item.name">
<EditAssetTab :ref="item.type" type="item.type" :edit-asset-data="editAssetData" :active-name="item.name" />
</el-tab-pane>
</el-tabs>
</div>

// 提交按钮
   submitAsset() {
      // 调用子组件的获取数据方法
      const refsMap = ['a', 'b', 'c', 'd', 'e', 'f'];
      refsMap.map(item => {
        this.originData = { ...this.originData, ...this.$refs[item].getAllQuery() };
      });
// ------子组件

//获取组件所有参数
getAllQuery() {
if (this.type === 'a') { // a->为父组件的ref的值
return {
ip_type: this.ip_type, // IP类型
ip_nat: this.ip_nat, // 映射IP
};
............

  

最新文章

  1. scala 宏
  2. 矢量化的HTML5拓扑图形组件设计
  3. 我开发 wangEditor-mobile 的故事
  4. NetCFSvcUtil.exe and Windows 7
  5. iOS开发之网络编程--中文转码
  6. layoutSubviews 浅尝
  7. Nginx,LVS,HAProxy,负载均衡之选择
  8. php 的一个pg_fetch_assoc的怪问题
  9. 关于ubuntu16.04给firefox安装flash的补充
  10. android之IntentFilter的用法_Intent.ACTION_TIME_TICK在manifest.xml不起作用
  11. windows(win10)下的mysql解压版安装
  12. nuget服务器搭建,以及如何发布一个Nuget包
  13. 帮Python找“对象”
  14. 【SAP HANA】SAP HANA开篇(1)
  15. js之省市区(县)三级联动效果
  16. 实现div里的img图片水平垂直居中
  17. 颜色 color
  18. AppStore企业账号打包发布APP流程详解
  19. PS合成的5个要点:场景、对比、氛围、模糊、纹理
  20. Python进阶-字符串格式化

热门文章

  1. 关键aspNetCore processPath 这一行,耗费了一天
  2. CMMI-QA工作流程(角色区分)
  3. 实现docker run命令
  4. pip3 install
  5. 远程连接linux桌面
  6. 解析bean封装成BeanDefinition
  7. 利用 fastjson 的 toJSONStringWithDateFormat 方法,将Date 格式化 为常见类型的时间
  8. Chtholly Tree 学习笔记
  9. DDD(一)微服务、领域驱动设计、领域模型
  10. Dashboard是什么意思 Dashboard怎么用?