mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 02:31:21 +00:00
[bugfix] Toast: ssr error (#1910)
This commit is contained in:
@@ -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 = {
|
||||
|
Reference in New Issue
Block a user