jeecg v3 表格自定义按钮打开Modal并传参

1.在template里加入

<UrAdspotsMapModal @register="register4" />
  

2.在脚本中import

import UrAdspotsMapModal from './components/UrAdspotsMapModal.vue'
  

3.在script里注册

const [register4, { openModal: openModal4 }] = useModal();
  

4.在函数里调用

function handleMapDetail(record: Recordable) {
  openModal4(true, {
    record
  });
}
  

5.在Action列引用

function getTableAction(record){
  return [{
      label: '地图',
      onClick: handleMapDetail.bind(null, record),
      }
    ]
}
  

6.Modal页面

<BasicForm @register="registerForm" :model="model" />

setup(props) {
const modelRef = ref({});
modelRef.value = { field2: data.record.lat, field1: data.record.lng };
return { ...,model: modelRef,...};

 

posted @   meetrice  阅读(171)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2019-09-19 Ubuntu 安装最新版 (1.12) Golang 并使用 go mod
点击右上角即可分享
微信分享提示