使用报错 Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 1 present.
<!-- 测试 -->
<el-dialog title="提示" :visible.sync="aa" width="30%">
<span>这是一段信息</span>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="dialogVisible = false"
>确 定</el-button
>
</span>
</el-dialog>
data() {
return {
aa: true,
}
}
document.addEventListener(
setInterval(() => {
this.aa = true;
}, 3000)
);
没有传参数!!!
修改
document.addEventListener(
setInterval(() => {
this.aa = true;
}, 3000),false
);