Vue how to click on the sidebar to appear, and then click on the blank sidebar to disappear?

<div class="scan" v-on:click="show">
    <svg class="icon" aria-hidden="true">
    <use xlink:href="-sharpicon-xiangji_"></use>
    </svg>
</div>

<div id="cam" v-show="flag">
    <button @click="back"></button>
    
</div>

js Code

var vm=new Vue({
        el:"-sharpapp",
        data:{
            flag:false,
        },
        methods:{
            show(){
                var sp=document.getElementById("cam");
                if(sp){
                    if(!sp.contains(event.target)){
                        this.flag=!this.flag
                    }
                }
            },
            back(){
                this.flag=!this.flag
            }
        }
    })

this method found on the Internet does not seem to work, it only works for the current button. Ask for the guidance of the Great God

    var sp=document.getElementById("cam");
                if(sp){
                    if(!sp.contains(event.target)){
                        this.flag=!this.flag
                    }
                }
Mar.13,2021

mounted() {
    $('-sharpcam').on('click', (event) => event.stopPropagation());
    $(document).on('click', () => {
        this.back();
    });
},
methods: {
    show() {
        this.flag = true;
    },
    back(){
        this.flag = false;
    }
}
Menu