//
<template>
<section v-show="bool">11</section>
</template>
<script>
export default {
data() {
return {
bool: false
};
},
mounted() {
},
methods: {
aaa() {
let that = this;
that.bool = true;
console.log(that.bool);
setTimeout(() => {
that.bool = false;
console.log(that.bool);
}, 2000);
}
}
};
</script>
< hr >
//
<template>
<section>
<zujian></zujian>
</section>
</template>
<script>
import zujian from "@/components/zujian";
export default {
data() {
},
mounted() {
zujian.methods.aaa();
},
components: {
zujian
}
};
</script>
after the parent component is called, the console
of the child component is correct twice, but the state of the child component does not change.