node.scrollIntoView({behavior: "smooth"});
TypeError: node.scrollIntoView is not a function.
你能告诉我为什么会这样吗focusDiv() {
var node = this.refs.theDiv;
node.scrollIntoView();
console.log("node--->" + node);
}
答案 0 :(得分:0)
替换:
var node = this.refs.theDiv;
使用:
var node = this.refs.theDiv.getDOMNode();