diff --git a/packages/runtime-core/src/createRenderer.ts b/packages/runtime-core/src/createRenderer.ts index 8c5860e67..1a27b1131 100644 --- a/packages/runtime-core/src/createRenderer.ts +++ b/packages/runtime-core/src/createRenderer.ts @@ -318,7 +318,6 @@ export function createRenderer(options: RendererOptions) { // style // this flag is matched when the element has dynamic style bindings - // TODO separate static and dynamic styles? if (patchFlag & STYLE) { hostPatchProp(el, 'style', newProps.style, oldProps.style, isSVG) } diff --git a/packages/runtime-core/src/index.ts b/packages/runtime-core/src/index.ts index ce76e3fe8..46d547da0 100644 --- a/packages/runtime-core/src/index.ts +++ b/packages/runtime-core/src/index.ts @@ -9,6 +9,7 @@ export { Portal } from './vnode' +export { nextTick } from './scheduler' export { createComponent, FunctionalComponent } from './component' export { createRenderer, RendererOptions } from './createRenderer' export { Slot, Slots } from './componentSlots' diff --git a/packages/runtime-core/src/patchFlags.ts b/packages/runtime-core/src/patchFlags.ts index ff7a4ce52..119111f1c 100644 --- a/packages/runtime-core/src/patchFlags.ts +++ b/packages/runtime-core/src/patchFlags.ts @@ -25,6 +25,11 @@ export const TEXT = 1 export const CLASS = 1 << 1 // Indicates an element with dynamic style +// The compiler pre-compiles static string styles into static objects +// + detects and hoists inline static objects +// e.g. style="color: red" and :style="{ color: 'red' }" both get hoisted as +// const style = { color: 'red' } +// render() { return e('div', { style }) } export const STYLE = 1 << 2 // Indicates an element that has non-class/style dynamic props.