1👍
Refs when used in the template are automatically unwrapped, meaning your line
@click="increment2(count)"
is equivalent to
@click="increment2(count.value)"
Which is not reactive. What you want to do is send the actual count ref, which can only be done within your <script>
tag
import { increment } from "./increment.js";
const increment2 = () => {
increment(count);
};
<button @click="increment2">Action2</button>
Source:stackexchange.com