How to use the xadmin.Block function in xadmin

To help you get started, we’ve selected a few xadmin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sshwsfc / xadmin / xadmin-dashboard / src / editor / components / Menu.js View on Github external
const Widget = widgets[key]
              return <menuitem>this.addCell(key)}&gt;{Widget.Title}</menuitem>
            })
          }
        
        
        
          <menuitem>this.changeLayer(null)}&gt;取消编辑</menuitem>
          {
            layers &amp;&amp; layers.map((layer, i) =&gt; {
              return <menuitem>this.changeLayer(i)}&gt;{`第${i+1}层`}</menuitem>
            })
          }
        
         随机数据
        {Block('dashboard.menu', this)}
      
    )
  }
github sshwsfc / xadmin / examples / xadmin-demo / src / dashboard / editor.js View on Github external
const Design = (props) =&gt; (
  <div style="{{">
    { Block('main', { props })}
    
  </div>
)
github sshwsfc / xadmin / packages / xadmin-antd / src / model / components / Items.js View on Github external
if(canOrder) {
      orderItems = [
        { changeOrder('ASC') }} key="ASC"&gt; {_t('Sort ASC')},
        { changeOrder('DESC') }} key="DESC"&gt; {_t('Sort DESC')}
      ]
      if(order != '') {
        orderItems.push({ changeOrder('') }}&gt; {_t('Clear order')})
      }
    }
    return orderItems
  }
  const icon = {
    'ASC' : ,
    'DESC' : 
  }[order] || ''
  const items = [ ...renderOrder(), ...(Block('model.list.header.menu') || []) ]
  
  return (items.filter(item=&gt;!_.isNil(item)).length&gt;0) ? (
    {React.Children.toArray(items)}
    )} trigger={[ 'click' ]}&gt;
      <a style="{{">{title} {icon}</a>
    
  ) : ( showText === false ? null : <span>{title} {icon}</span>)

}
github sshwsfc / xadmin / packages / xadmin-antd / src / layout / Dashboard.js View on Github external
render() {
    const { _t } = app.context
    return <div>{_t('Welcome, Have a nice day!')}</div>{Block('dashboard.main', this)}
  }
}
github sshwsfc / xadmin / packages / xadmin-antd / src / model / components / DataTable.js View on Github external
render() {
    const { title, order, showText } = this.props
      , icon = {
        'ASC' : ,
        'DESC' : 
      }[order] || ''
    const items = [ ...this.renderOrder(), ...(Block('model.list.header.menu', this) || []) ]
    return (items.filter(item=&gt;!_.isNil(item)).length&gt;0) ? (
      {React.Children.toArray(items)}
      )} trigger={[ 'click' ]}&gt;
        <a style="{{">{title} {icon}</a>
      
    ) : ( showText === false ? null : <span>{title} {icon}</span>)
  }
github sshwsfc / xadmin / xadmin-dashboard / src / editor / components / Header.js View on Github external
<a>this.setState({ showDataModal: true })}&gt;数据源</a>
              
              
                <a>this.setState({ showConnectModal: true })}&gt;接口管理</a>
              
            
          
          
            
              <button>
            
            
              </button><button type=""> 
            
            {Block('dashboard.menu', this)}
          
        
      
    ), 
      this.setState({ showDashboardModal: false })} /&gt;,
      this.setState({ showDataModal: false })} /&gt;,
      this.setState({ showConnectModal: false })} /&gt;
    ]
  }
}</button>