]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip: compare perf
authorEvan You <yyx990803@gmail.com>
Sun, 26 May 2019 07:38:55 +0000 (15:38 +0800)
committerEvan You <yyx990803@gmail.com>
Sun, 26 May 2019 07:38:55 +0000 (15:38 +0800)
packages/runtime-core/src/createRenderer.ts
packages/runtime-dom/src/patchProp.ts
packages/runtime-dom/src/rendererOptions.ts

index 74ddf2b3a612fbefc889a8a45658c9ef938a2938..d700809dbaabcea2e9f9c28bb872db95f4d6dbb7 100644 (file)
@@ -193,7 +193,7 @@ export function createRenderer(options: RendererOptions) {
       if (patchFlag & CLASS) {
         // TODO handle full class API, potentially optimize at compilation stage?
         if (oldProps.class !== newProps.class) {
-          el.className = newProps.class
+          hostPatchProp(el, 'class', newProps.class, null, false)
         }
       }
 
@@ -201,7 +201,7 @@ export function createRenderer(options: RendererOptions) {
       // this flag is matched when the element has dynamic style bindings
       // TODO separate static and dynamic styles?
       if (patchFlag & STYLE) {
-        hostPatchProp(el, 'style', oldProps.style, newProps.style, false)
+        hostPatchProp(el, 'style', newProps.style, oldProps.style, false)
       }
 
       // props
index 98c5b5a574ed9d0385bc12a594af0bc961ef4728..56a3a2e9fd3ead3a7aabb672f79518581871dcb9 100644 (file)
@@ -9,8 +9,8 @@ import { VNode } from '@vue/runtime-core'
 export function patchProp(
   el: Element,
   key: string,
-  prevValue: any,
   nextValue: any,
+  prevValue: any,
   isSVG: boolean,
   prevChildren?: VNode[],
   unmountChildren?: any
index e71a72ce9d8d8446458a9a875d5c2e639f363b4c..05757a9c33fd65807cbc5c479bb9e6bf9a8078b4 100644 (file)
@@ -6,7 +6,7 @@ const svgNS = 'http://www.w3.org/2000/svg'
 export const DOMRendererOptions: RendererOptions = {
   patchProp,
 
-  insert: (parent: Node, child: Node, anchor?: Node) => {
+  insert: (child: Node, parent: Node, anchor?: Node) => {
     if (anchor != null) {
       parent.insertBefore(child, anchor)
     } else {