iview table组件里面render渲染的按钮如何阻止事件冒泡?

vue 的官方文档上找到了render的解释 [事件 & 按键修饰符].
render函数中 自带event事件,不用传参。不用写e,直接event.stopPropagetion()就可以了。

{
            title: '中继',
            minWidth: 100,
            align: 'center',
            // key: '',
            render: (h, params) => {
              let _this = this;
              let linkListArray = params.row.linkList.split('|');
              let buttonText = '';
              if (linkListArray.length === 0 || (linkListArray.length === 1 && linkListArray[0] === '')) {
                buttonText = '无';
              } else {
                buttonText = linkListArray.length + '级';
              }
              return h('i-button', {
                props: {
                  type: 'info',
                  size: 'small'
                },
                on: {
                  click () {
                    event.stopPropagation();
                    _this.relayInfo.relayTargetDeviceCode = params.row.deviceCode;
                    _this.relayInfo.relayAreaId = params.row.areaId;
                    _this.relayInfo.currentDeviceLinkList = params.row.linkList;
                    _this.$refs.temporaryRelayModal.openModal();
                  }
                }
              }, buttonText);
            }
          }

你可能感兴趣的:(iview table组件里面render渲染的按钮如何阻止事件冒泡?)