<template>
  <span v-if="hasPermission">
    <slot></slot>    
  </span>
</template>
<script>
  export default{
    name: 'OptionRight',
    components:{

    },
    props:{
      resourceCode:{
        type:String,
        default(){
          return '';
        }
      }
    },
    data(){
      return{

      }
    },
    computed:{
      hasPermission(){
        let optionList = [];
        if(this.$store){
          optionList = this.$store.state.optionRight;
        }else if($store){
          optionList = $store.state.optionRight;
        }
        if(optionList && optionList.length && optionList.includes(this.resourceCode)){
          return true
        }
        return false
      }
    },
    created:function(){
    },
    beforeMount:function(){

    },
    mounted:function(){
    },
    beforeDestroy:function(){

    },
    destroyed:function(){

    },
    methods:{
      // hasPermission(){
      //   let optionList = this.$store.state.optionRight;
      //   if(optionList && optionList.length && optionList.includes(this.resourceCode)){
      //     return true
      //   }
      //   return false
      // }
    },
    watch:{

    },
    directives:{

    }
  }
</script>
