-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path42.ts
More file actions
104 lines (80 loc) · 2.11 KB
/
42.ts
File metadata and controls
104 lines (80 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
export default class Vue {
static __patch__: any;
}
function createPatchFunction(param: { nodeOps: any; modules: any }) {
function patch(oldVnode,vnode,hydrating,removeOnly) {
// other
return vnode.elm
}
return this.patch() // just for return
}
interface ScopeSlot {
}
interface VNodeDirective {
}
interface VNode {
}
interface Component {
$el: any;
$createElement: Function;
_renderProxy: Function;
$options: any;
__patch__($el: any, vnode: VNode, hydrating: boolean, b: boolean): any;
}
export interface VNodeData {
key?: string | number;
slot?: string;
scopedSlots?: { [key: string]: ScopeSlot | undefined };
ref?: string;
refInFor?: string;
tag?: string;
staticClass?: string;
class?: any;
staticStyle?: { [key: string]: any };
style?: string | object[] | object;
props?: { [key: string]: any };
attrs?: { [key: string]: any };
domProps?: { [key: string]: any };
hook?: { [key: string]: Function };
on?: { [key: string]: Function | Function[] };
nativeOn?: { [key: string]: Function | Function[] };
transition?: object;
show?: boolean;
inlineTemplate?: {
render: Function,
staticRenderFns: Function[]
};
directives?: VNodeDirective[];
keepAlive?: boolean;
}
let inBrowser;
let nodeOps;
let modules;
function noop() {
}
function _render(): VNode {
const vm: Component = this
const {render, _parentVnode} = vm.$options
//...
// render self
let vnode
try {
let currentRenderingInstance; // for ignore error
currentRenderingInstance = vm
vnode = render.call(vm._renderProxy, vm.$createElement)
} catch (e) {
throw new Error(e)
}
return vnode
}
function _update(vnode: VNode, hydrating: boolean) {
const vm: Component = this;
// ... others
let prevNode; // for ignore error
if (!prevNode) {
vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false);
}
// other ....
}
export const patch:Function = createPatchFunction({ nodeOps, modules });
Vue.__patch__ = inBrowser ? patch : noop;