chore: notes on style binding optimization
This commit is contained in:
parent
2848f65a7f
commit
c442785465
@ -318,7 +318,6 @@ export function createRenderer(options: RendererOptions) {
|
|||||||
|
|
||||||
// style
|
// style
|
||||||
// this flag is matched when the element has dynamic style bindings
|
// this flag is matched when the element has dynamic style bindings
|
||||||
// TODO separate static and dynamic styles?
|
|
||||||
if (patchFlag & STYLE) {
|
if (patchFlag & STYLE) {
|
||||||
hostPatchProp(el, 'style', newProps.style, oldProps.style, isSVG)
|
hostPatchProp(el, 'style', newProps.style, oldProps.style, isSVG)
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ export {
|
|||||||
Portal
|
Portal
|
||||||
} from './vnode'
|
} from './vnode'
|
||||||
|
|
||||||
|
export { nextTick } from './scheduler'
|
||||||
export { createComponent, FunctionalComponent } from './component'
|
export { createComponent, FunctionalComponent } from './component'
|
||||||
export { createRenderer, RendererOptions } from './createRenderer'
|
export { createRenderer, RendererOptions } from './createRenderer'
|
||||||
export { Slot, Slots } from './componentSlots'
|
export { Slot, Slots } from './componentSlots'
|
||||||
|
@ -25,6 +25,11 @@ export const TEXT = 1
|
|||||||
export const CLASS = 1 << 1
|
export const CLASS = 1 << 1
|
||||||
|
|
||||||
// Indicates an element with dynamic style
|
// 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
|
export const STYLE = 1 << 2
|
||||||
|
|
||||||
// Indicates an element that has non-class/style dynamic props.
|
// Indicates an element that has non-class/style dynamic props.
|
||||||
|
Loading…
Reference in New Issue
Block a user