-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: functional component support for compiled templates
- Loading branch information
Showing
5 changed files
with
162 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* @flow */ | ||
|
||
import { toNumber, toString, looseEqual, looseIndexOf } from 'shared/util' | ||
import { createTextVNode, createEmptyVNode } from 'core/vdom/vnode' | ||
import { renderList } from './render-list' | ||
import { renderSlot } from './render-slot' | ||
import { resolveFilter } from './resolve-filter' | ||
import { checkKeyCodes } from './check-keycodes' | ||
import { bindObjectProps } from './bind-object-props' | ||
import { renderStatic, markOnce } from './render-static' | ||
import { bindObjectListeners } from './bind-object-listeners' | ||
import { resolveScopedSlots } from './resolve-slots' | ||
|
||
export function installRenderHelpers (target: any) { | ||
target._o = markOnce | ||
target._n = toNumber | ||
target._s = toString | ||
target._l = renderList | ||
target._t = renderSlot | ||
target._q = looseEqual | ||
target._i = looseIndexOf | ||
target._m = renderStatic | ||
target._f = resolveFilter | ||
target._k = checkKeyCodes | ||
target._b = bindObjectProps | ||
target._v = createTextVNode | ||
target._e = createEmptyVNode | ||
target._u = resolveScopedSlots | ||
target._g = bindObjectListeners | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ea0d227
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol. The second you posted this, I just converted my dumb components to jsx based functional components ;)