You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.2 KiB
64 lines
1.2 KiB
<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){
|
|
console.log(temp.indexOf('search'))
|
|
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>
|