Skip to content

Commit feee9ef

Browse files
committed
remove camelCase tag warning
1 parent 8de6dec commit feee9ef

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

src/compiler/parser/index.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const bindRE = /^:|^v-bind:/
2323
const onRE = /^@|^v-on:/
2424
const argRE = /:(.*)$/
2525
const modifierRE = /\.[^\.]+/g
26-
const camelRE = /[a-z\d][A-Z]/
2726

2827
const decodeHTMLCached = cached(decodeHTML)
2928

@@ -60,16 +59,8 @@ export function parse (
6059
expectHTML: options.expectHTML,
6160
isUnaryTag: options.isUnaryTag,
6261
start (tag, attrs, unary) {
63-
// check camelCase tag
64-
if (camelRE.test(tag)) {
65-
process.env.NODE_ENV !== 'production' && warn(
66-
`Found camelCase tag in template: <${tag}>. ` +
67-
`I've converted it to <${hyphenate(tag)}> for you.`
68-
)
69-
tag = hyphenate(tag)
70-
}
71-
72-
tag = tag.toLowerCase()
62+
// normalize tag name
63+
tag = hyphenate(tag)
7364

7465
// check namespace.
7566
// inherit parent ns if there is one

test/unit/modules/compiler/parser.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ describe('parser', () => {
4848
const ast = parse('<MyComponent><p>hello world</p></MyComponent>', baseOptions)
4949
expect(ast.tag).toBe('my-component')
5050
expect(ast.plain).toBe(true)
51-
expect('Found camelCase tag in template').toHaveBeenWarned()
5251
expect(ast.children[0].tag).toBe('p')
5352
expect(ast.children[0].plain).toBe(true)
5453
expect(ast.children[0].children[0].text).toBe('hello world')

0 commit comments

Comments
 (0)