需求是在提交的表单数据里,子表单里有个组件是放链接地址的,然后点击后面的详情可以打开链接。
但现在不知道怎么获取当前操作行的指定组件的值
export function onActionClick({ index, groupId, itemValue, actionKey }) {
console.log(actionKey);
const subFormInst = this.$('tableField_mbkgnfok');
// 先获取 行 标识
const items = subFormInst.getItems(); // ["tfitem_1", "tfitem_2"]
items.forEach(item => {
const fieldInst = subFormInst.getComponent(item, 'textField_mbkgnfoo');
console.log(fieldInst.getValue());
alert(fieldInst.getValue())
});
}
上面代码获取到的是子表里该组件的所有值,请问有什么办法实现这个需求吗
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
非常简单,你从itemValue中获取值就行了。
export function onActionClick({ index, groupId, itemValue, actionKey }) {
console.log(itemValue);// 打印itemValue看下
this.utils.router.push(itemValue.textField_llq89po4, {}, true, true);// 调用宜搭的路由工具实现链接跳转,替换textField_llq89po4为联系人地址字段的唯一标识
}