如题,如果我们需要报错的提示时间展示的长一点该怎么做呢?
比如下面这个:
<script>
export default {
methods: {
open() {
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '删除成功!'
});
}).catch(() => {
this.$message({
duration: 10000,
type: 'info',
message: '已取消删除'
});
});
}
}
}
</script>
我们在已取消删除那里加上了它:duration: 10000, 代表这个提示的显示时长是10秒
duration的默认值是3000毫秒,本来element-ui那里应该有这个属性,可惜现在没有了。