Skip to content

11 - 下一次DOM更新 #2300

Open
Open
@RanGuMo

Description

@RanGuMo

请调出控制台看输出结果
写法一:

async function increment() {
  count.value++
  await nextTick();
  console.log(+counter.value.textContent === 1)
}

写法二:

function increment() {
  count.value++
 nextTick(()=>{
   console.log(+counter.value.textContent === 1)
  })
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions