为什么在这个很小的示例中未调用.await函数?
的HTML
<h1>test</h1>
<div id="a"></div>
<div id="b"></div>
Run Code Online (Sandbox Code Playgroud)
JS
d3.queue()
.defer(a,1)
.await(b,2);
function a(x){
d3.select('#a').text("a is executing with x="+x);
}
function b(err,x){
d3.select('#b').text("b is executing with x="+x);
}
Run Code Online (Sandbox Code Playgroud)
输出量
test
a is executing with x=1
Run Code Online (Sandbox Code Playgroud)