<template>
    <!-- <div class="denet-toolbox" @click.stop="clickHead">
        
    </div> -->
    <input type="button" value="点击" @click="state.show = !state.show">
    <p v-if="state.show" :data-view="1" :data-click="'按钮'" @click.stop="clickTest">1</p>
    <p v-else :data-view="2">2</p>

</template>
<script setup>
import { onMounted, reactive } from "vue";

let state = reactive({
    show: false
})
onMounted(() => {
    var io = new IntersectionObserver((e) => {
        console.log(e[0].target)
    });
    io.observe(document.querySelector('p[data-view]'))

})

function clickTest() {
    console.log('clickTest')
}

</script>

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