List列表页面行内添加自定义按钮,弹出自定义页面
分五步
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,...};
标签:传参,Modal,自定义,record,v3,modelRef,按钮,页面 From: https://www.cnblogs.com/meetrice/p/18420605