chushihua
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
const doc = (typeof document === 'undefined') ? {
|
||||
body: {},
|
||||
addEventListener() {},
|
||||
removeEventListener() {},
|
||||
activeElement: {
|
||||
blur() {},
|
||||
nodeName: '',
|
||||
},
|
||||
querySelector() {
|
||||
return null;
|
||||
},
|
||||
querySelectorAll() {
|
||||
return [];
|
||||
},
|
||||
getElementById() {
|
||||
return null;
|
||||
},
|
||||
createEvent() {
|
||||
return {
|
||||
initEvent() {},
|
||||
};
|
||||
},
|
||||
createElement() {
|
||||
return {
|
||||
children: [],
|
||||
childNodes: [],
|
||||
style: {},
|
||||
setAttribute() {},
|
||||
getElementsByTagName() {
|
||||
return [];
|
||||
},
|
||||
};
|
||||
},
|
||||
location: { hash: '' },
|
||||
} : document; // eslint-disable-line
|
||||
|
||||
export default doc;
|
||||
Reference in New Issue
Block a user