[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

@@ -1,6 +1,6 @@
import Vue from 'vue';
import VueToast from './Toast';
import { isObj } from '../utils';
import { isObj, isServer } from '../utils';
const defaultOptions = {
type: 'text',
@@ -37,6 +37,11 @@ function transformer(options) {
}
function Toast(options = {}) {
/* istanbul ignore if */
if (isServer) {
return;
}
const toast = createInstance();
options = {