react-authority
authority component
Last updated a year ago by leeqq .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install react-authority 
SYNC missed versions from official npm registry.

react-authority

install

$ npm install react-authority --save-dev

usage

import React, { Component } from 'react';
import ReactDom from 'react-dom';
import ReactAuthority from 'react-authority';

ReactDOM.render((
  <ReactAuthority code="create" permission={['create']}>
    <button>创建</button>
  </ReactAuthority>
), document.getElementById('root'));

ReactDOM.render((
  <ReactAuthority code="detail" permission={['create']}>
    <ReactAuthority.Admit>
      <a href="url-to-detail">查看详情</a>
    </ReactAuthority.Admit>
    <ReactAuthority.Deny>
      没有查看权限,没有链接
    </ReactAuthority.Deny>
  </ReactAuthority>
), document.getElementById('root'));

Current Tags

  • 1.0.4                                ...           latest (a year ago)

5 Versions

  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 9
Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |