
<script>

// v-exif: 自定义扩展


export default  {
    init(Vue){
        Vue.directive('isEnv', {

            bind(el, binding, vnode, oldVnode) {

            },
            inserted(el, binding, vnode, oldVnode){
                var envFlag = vnode.child.$store.state.envCfg.envFlag;
                var envlist = binding.value;
                if(typeof(envlist) === "string"){
                    envlist = envlist.split(",")
                }
                if(!envlist.find((item)=> item==envFlag )){
                    if(el.parentNode) el.parentNode.removeChild(el)
                }
            }
        
        })
        Vue.directive('isNEnv', {

            bind(el, binding, vnode, oldVnode) {

            },
            inserted(el, binding, vnode, oldVnode){
                var envFlag = vnode.child.$store.state.envCfg.envFlag;
                var envlist = binding.value;
                if(typeof(envlist) === "string"){
                    envlist = envlist.split(",")
                }
                if(envlist.find((item)=> item==envFlag )){
                    if(el.parentNode) el.parentNode.removeChild(el)
                }
            }
        
        })
    }
}



</script>