美文网首页
2018-06-05逻辑与

2018-06-05逻辑与

作者: NOTEBOOK2 | 来源:发表于2018-06-05 17:35 被阅读0次

    &&只有在用逻辑与的时候才发现自己是没有逻辑的

        let gridActions = [
          {
            name: 'View',
            hide: () => !viewPermission,
            onClick: (item) => {
              const { id } = item;
              let { store_id } = this.props.params;
              routeHelper.goProductionOrders(store_id, id);
            }
          },
          {
            name: 'Approve',
            hide: (item) => !(approvalPermission && item.state === 'created'),
            onClick: (item) => {
              const { id } = item;
              this.props.actions.approve(id)
            }
          },
          {
            name: 'Cancel',
            hide: (item) => !(cancelPermission && ['fulfilled', 'canceled'].indexOf(item.state) === -1),
            onClick: (item) => {
              if (!confirm('Do you really want to cancel this order?')) return false;
              const { id } = item;
              this.props.actions.cancel(id)
            }
          }
        ];  
    

    相关文章

      网友评论

          本文标题:2018-06-05逻辑与

          本文链接:https://www.haomeiwen.com/subject/iudmsftx.html