Merge pull request #142 from Leopoldthecoder/master

add padding-right when popup shows
pull/147/head
baiyaaaaa 2016-09-24 18:09:37 +08:00 committed by GitHub
commit 8fecdaabce
6 changed files with 42 additions and 26 deletions

View File

@ -9,15 +9,19 @@
this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$message({ setTimeout(() => {
message: '删除成功!', this.$message({
type: 'success' message: '删除成功!',
}); type: 'success'
});
}, 200);
}).catch(() => { }).catch(() => {
this.$message({ setTimeout(() => {
message: '已取消删除', this.$message({
type: 'info' message: '已取消删除',
}); type: 'info'
});
}, 200);
}); });
}, },
@ -26,15 +30,19 @@
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/,
inputErrorMessage: '邮箱格式不正确' inputErrorMessage: '邮箱格式不正确'
}).then(({ value }) => { }).then(({ value }) => {
this.$message({ setTimeout(() => {
type: 'success', this.$message({
message: '你的邮箱是: ' + value type: 'success',
}); message: '你的邮箱是: ' + value
});
}, 200);
}).catch(() => { }).catch(() => {
this.$message({ setTimeout(() => {
type: 'info', this.$message({
message: '取消输入' type: 'info',
}); message: '取消输入'
});
}, 200);
}); });
}, },
@ -45,10 +53,12 @@
message: '这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容', message: '这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容, 这是一段内容',
showCancelButton: true showCancelButton: true
}).then(action => { }).then(action => {
this.$message({ setTimeout(() => {
type: 'info', this.$message({
message: 'action: ' + action type: 'info',
}); message: 'action: ' + action
});
}, 200);
}); });
} }

View File

@ -71,7 +71,7 @@
"vue": "^2.0.0-rc.6", "vue": "^2.0.0-rc.6",
"vue-loader": "^9.4.2", "vue-loader": "^9.4.2",
"vue-markdown-loader": "^0.5.1", "vue-markdown-loader": "^0.5.1",
"vue-popup": "^0.2.4", "vue-popup": "^0.2.5",
"vue-router": "^2.0.0-beta.2", "vue-router": "^2.0.0-beta.2",
"webpack": "^1.13.2", "webpack": "^1.13.2",
"webpack-dev-server": "^1.15.1", "webpack-dev-server": "^1.15.1",

View File

@ -12,6 +12,6 @@
"author": "elemefe", "author": "elemefe",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"vue-popup": "^0.2.4" "vue-popup": "^0.2.5"
} }
} }

View File

@ -12,6 +12,6 @@
"author": "elemefe", "author": "elemefe",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"vue-popup": "^0.2.4" "vue-popup": "^0.2.5"
} }
} }

View File

@ -7,6 +7,7 @@ var defaults = {
type: '', type: '',
showInput: false, showInput: false,
showClose: true, showClose: true,
modalFade: true,
closeOnClickModal: true, closeOnClickModal: true,
inputValue: null, inputValue: null,
inputPlaceholder: '', inputPlaceholder: '',

View File

@ -79,9 +79,14 @@
this.onClose && this.onClose(); this.onClose && this.onClose();
if (this.modal && this.bodyOverflow !== 'hidden') { setTimeout(() => {
document.body.style.overflow = this.bodyOverflow; if (this.modal && this.bodyOverflow !== 'hidden') {
} document.body.style.overflow = this.bodyOverflow;
document.body.style.paddingRight = this.bodyPaddingRight;
}
this.bodyOverflow = null;
this.bodyPaddingRight = null;
}, 200);
this.opened = false; this.opened = false;
if (!this.transition) { if (!this.transition) {