support Nuxt.js
This commit is contained in:
parent
825ed58099
commit
a68c11a565
4 changed files with 16 additions and 4 deletions
|
@ -1,3 +1,5 @@
|
|||
import Vue from 'vue';
|
||||
const isServer = Vue.prototype.$isServer;
|
||||
// 判断参数是否是其中之一
|
||||
export function oneOf (value, validList) {
|
||||
for (let i = 0; i < validList.length; i++) {
|
||||
|
@ -52,7 +54,7 @@ export function getScrollBarSize (fresh) {
|
|||
}
|
||||
|
||||
// watch DOM change
|
||||
export const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver || false;
|
||||
export const MutationObserver = isServer ? false : window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver || false;
|
||||
|
||||
const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
||||
const MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import Vue from 'vue';
|
||||
|
||||
const isServer = Vue.prototype.$isServer;
|
||||
|
||||
/* istanbul ignore next */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue