Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parsePlatformTagName config #4417

Merged
merged 1 commit into from
Dec 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/core/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type Config = {
keyCodes: { [key: string]: number };
// platform
isReservedTag: (x?: string) => boolean;
parsePlatformTagName: (x: string) => string;
isUnknownElement: (x?: string) => boolean;
getTagNamespace: (x?: string) => string | void;
mustUseProp: (tag?: string, x?: string) => boolean;
Expand Down Expand Up @@ -69,6 +70,11 @@ const config: Config = {
*/
getTagNamespace: noop,

/**
* Parse the real tag name for the specific platform.
*/
parsePlatformTagName: (x: string): string => x,

/**
* Check if an attribute must be bound using property, e.g. value
* Platform-dependent.
Expand Down
2 changes: 1 addition & 1 deletion src/core/vdom/create-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function _createElement (
if (config.isReservedTag(tag)) {
// platform built-in elements
vnode = new VNode(
tag, data, children,
config.parsePlatformTagName(tag), data, children,
undefined, undefined, context
)
} else if ((Ctor = resolveAsset(context.$options, 'components', tag))) {
Expand Down