Vue.nextTickとは? callbackを延期し、DOMの更新サイクル後に実行します。DOM更新を待ち受けるために、いくつかのデータを変更した直後に使用してください。 VueはDOMを非同期に更新するため、「DOMを更新した後にその更新済みのDOMに対して何らかの処理をする」といったような場面でnextTickが役立ちます。 // single file component <template> <div>{{ message }}</div> </template> <script> export default { data() { return { message: 'default' } }, mounted() { this.message = 'hello'; console.log(this.$el.textContent); // default この時点ではまだD
![Vue.nextTickのコードリーディング](https://cdn-ak-scissors.b.st-hatena.com/image/square/6b6f6275219fd1bc26ec6842307c7297b49f3976/height=288;version=1;width=512/https%3A%2F%2Faloerina01.github.io%2Fassets%2Flogo_whitebg.png)