<script>
export default {
  props:{
    auths:{
      type:Array,
      default:()=>[]
    }
  },
  data() {
    return {}
  },
  methods: {

  },
  render(){
    let _this = this
    //权限排序后(让按钮排序)
    let temp = JSON.parse(JSON.stringify(this.auths))
    if(temp.indexOf('search') !== -1){
      temp.splice(temp.indexOf('search'),1)
      temp.unshift('search')
    }

    console.log(temp)
    return (
      <div style={
        {
          'display':'flex',
          'flex-warp':'wrap'
        }
      }>
        <div style={
          {
            'margin-right':'10px'
          }
        }>
          { _this.$scopedSlots.default ? _this.$scopedSlots.default() : '' }
        </div>
        {
          temp.map((item,index) => {
            if(_this.$scopedSlots[item]){
              return (
                <div style={
                  {
                    'margin-right':'10px'
                  }
                }>
                  { _this.$scopedSlots[item](item,index) }
                </div>
              )
            }
          })
        }
      </div>
    )
  }

}
</script>

<style scoped lang="scss">
</style>
