mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Add performance marks
This commit is contained in:
parent
f9e024c000
commit
d06da0b09e
@ -21,7 +21,9 @@ export class VNodeManager {
|
|||||||
|
|
||||||
constructor(public rootElement: HTMLElementWithVue) {}
|
constructor(public rootElement: HTMLElementWithVue) {}
|
||||||
|
|
||||||
|
/** 从结束元素向上写入递归范围 */
|
||||||
traverseToRoot(element: HTMLElementWithVue): HTMLElementWithVue {
|
traverseToRoot(element: HTMLElementWithVue): HTMLElementWithVue {
|
||||||
|
performance.mark('traverseToRoot')
|
||||||
if (element._vnode) {
|
if (element._vnode) {
|
||||||
return element
|
return element
|
||||||
}
|
}
|
||||||
@ -50,6 +52,7 @@ export class VNodeManager {
|
|||||||
/** 解开组件实例的包装 */
|
/** 解开组件实例的包装 */
|
||||||
private unwrapSubtree(vnode: Vue3Vnode): Vue3Vnode {
|
private unwrapSubtree(vnode: Vue3Vnode): Vue3Vnode {
|
||||||
if (vnode.component?.subTree) {
|
if (vnode.component?.subTree) {
|
||||||
|
performance.mark('unwrapSubtree')
|
||||||
return this.unwrapSubtree(vnode.component?.subTree)
|
return this.unwrapSubtree(vnode.component?.subTree)
|
||||||
}
|
}
|
||||||
return vnode
|
return vnode
|
||||||
@ -60,6 +63,7 @@ export class VNodeManager {
|
|||||||
* @see https://github.com/the1812/Bilibili-Evolved/issues/4690#issuecomment-2059485344
|
* @see https://github.com/the1812/Bilibili-Evolved/issues/4690#issuecomment-2059485344
|
||||||
*/
|
*/
|
||||||
exposeVNode(vnode: Vue3Vnode = this.rootElement._vnode) {
|
exposeVNode(vnode: Vue3Vnode = this.rootElement._vnode) {
|
||||||
|
performance.mark('exposeVNode')
|
||||||
if (vnode.el && !vnode.el._vnode) {
|
if (vnode.el && !vnode.el._vnode) {
|
||||||
vnode.el._vnode = vnode
|
vnode.el._vnode = vnode
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user