UNPKG

1.51 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../../src/components/FuncPermission/FuncPermission.js"],"names":["FuncPermission","props","context","codes","curCode","code","result","length","resource","children","Component"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;;;AACA;;;;;;AALA;;;;IAOqBA,c;;;AAEnB,0BAAYC,KAAZ,EAAkBC,OAAlB,EAA2B;AAAA;AAAA,iJACnBD,KADmB,EACbC,OADa;AAE1B;;;;6BACO;AACN,UAAIC,QAAQ,KAAKF,KAAL,CAAWE,KAAvB;AACA,UAAIC,UAAU,KAAKH,KAAL,CAAWI,IAAzB;AACA,UAAIC,SAAS,IAAb;AACA,UAAGH,SAASA,MAAMI,MAAN,GAAe,CAA3B,EAA6B;AAAA;AAAA;AAAA;;AAAA;AAC3B,0DAAoBJ,KAApB,4GAA0B;AAAA,gBAAlBK,QAAkB;;AACxB,gBAAGJ,YAAYI,QAAf,EAAwB;AACtBF,uBAAU,KAAKL,KAAL,CAAWQ,QAArB;AACD;AACF;AAL0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAM5B;AACD,aACE;AAAA;AAAA;AAAOH;AAAP,OADF;AAGD;;;EAnByCI,gB;;kBAAvBV,c","file":"FuncPermission.js","sourcesContent":["/**\r\n * Created by songshuangwang on 2017/6/30.\r\n */\r\n\r\nimport React, {Component} from 'react';\r\nimport PropTypes from 'prop-types';\r\n\r\nexport default class FuncPermission extends Component {\r\n\r\n constructor(props,context) {\r\n super(props,context);\r\n }\r\n render(){\r\n let codes = this.props.codes;\r\n let curCode = this.props.code;\r\n let result = null;\r\n if(codes && codes.length > 0){\r\n for(let resource of codes){\r\n if(curCode === resource){\r\n result = this.props.children;\r\n }\r\n }\r\n }\r\n return(\r\n <span>{result}</span>\r\n );\r\n }\r\n\r\n}"]}
\No newline at end of file