[bugfix] Toast: ssr error (#1910)

This commit is contained in:
neverland
2018-10-09 18:12:02 +08:00
committed by GitHub
parent bcfa4ed3ac
commit 6858f4e2ea
7 changed files with 39 additions and 8 deletions

View File

@@ -136,6 +136,11 @@ export default create({
methods: {
handler(action) {
/* istanbul ignore if */
if (this.$isServer) {
return;
}
if (action !== this.handlerStatus && this.hideOnClickOutside) {
this.handlerStatus = action;
document.body[(action ? 'add' : 'remove') + 'EventListener']('touchstart', this.onBlur);