Closed userzeor closed 1 week ago
This is the expected behavior. <script setup>
block will be executed each time an instance of the component is created. In Slidev, the slide component can have two instances: one in the main play view, and one in the slides overview.
If you want the code to execute only once, you can add another <script>
block without setup
.
Thank you for your answer
/components/Counter.vue组件里面的代码
在使用组件的页面刷新console.log会执行两次