Skip to content

Commit

Permalink
fix(vue-challenges): nextTick() API
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 29, 2022
1 parent 2719391 commit e3e5683
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<script setup>
import { ref } from 'vue';
import { nextTick, ref } from 'vue';
const count = ref(0);
const counter = ref(null);
function increment() {
async function increment() {
count.value++;
/**
* DOM is not yet updated, how can we make sure that the DOM gets updated
* Make the output be true
*/
await nextTick();
console.log(+counter.value.textContent === 1);
}
</script>
Expand Down

0 comments on commit e3e5683

Please sign in to comment.