File tree Expand file tree Collapse file tree 3 files changed +8
-15
lines changed Expand file tree Collapse file tree 3 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -245,7 +245,7 @@ function compileElement (el, options) {
245
245
}
246
246
// check component
247
247
if ( ! linkFn ) {
248
- linkFn = checkComponent ( el , options )
248
+ linkFn = checkComponent ( el , options , hasAttrs )
249
249
}
250
250
// normal directives
251
251
if ( ! linkFn && hasAttrs ) {
@@ -573,11 +573,12 @@ function checkElementDirectives (el, options) {
573
573
*
574
574
* @param {Element } el
575
575
* @param {Object } options
576
+ * @param {Boolean } hasAttrs
576
577
* @return {Function|undefined }
577
578
*/
578
579
579
- function checkComponent ( el , options ) {
580
- var componentId = _ . checkComponent ( el , options )
580
+ function checkComponent ( el , options , hasAttrs ) {
581
+ var componentId = _ . checkComponent ( el , options , hasAttrs )
581
582
if ( componentId ) {
582
583
var componentLinkFn = function ( vm , el , host ) {
583
584
vm . _bindDir ( 'component' , el , {
Original file line number Diff line number Diff line change @@ -48,13 +48,6 @@ function enableDebug () {
48
48
exports . assertAsset = function ( val , type , id ) {
49
49
/* istanbul ignore if */
50
50
if ( type === 'directive' ) {
51
- if ( id === 'component' ) {
52
- exports . warn (
53
- 'v-component can only be used on table elements ' +
54
- 'in ^0.12.0. Use custom element syntax instead.'
55
- )
56
- return
57
- }
58
51
if ( id === 'with' ) {
59
52
exports . warn (
60
53
'v-with has been deprecated in ^0.12.0. ' +
@@ -74,4 +67,4 @@ function enableDebug () {
74
67
exports . warn ( 'Failed to resolve ' + type + ': ' + id )
75
68
}
76
69
}
77
- }
70
+ }
Original file line number Diff line number Diff line change @@ -77,13 +77,12 @@ function formatValue (val) {
77
77
*
78
78
* @param {Element } el
79
79
* @param {Object } options
80
+ * @param {Boolean } hasAttrs
80
81
* @return {String|undefined }
81
82
*/
82
83
83
84
exports . commonTagRE = / ^ ( d i v | p | s p a n | i m g | a | b r | u l | o l | l i | h 1 | h 2 | h 3 | h 4 | h 5 | c o d e | p r e ) $ /
84
- exports . tableElementsRE = / ^ c a p t i o n | c o l g r o u p | t h e a d | t f o o t | t b o d y | t r | t d | t h $ /
85
-
86
- exports . checkComponent = function ( el , options ) {
85
+ exports . checkComponent = function ( el , options , hasAttrs ) {
87
86
var tag = el . tagName . toLowerCase ( )
88
87
if ( tag === 'component' ) {
89
88
// dynamic syntax
@@ -96,7 +95,7 @@ exports.checkComponent = function (el, options) {
96
95
) {
97
96
return tag
98
97
} else if (
99
- exports . tableElementsRE . test ( tag ) &&
98
+ hasAttrs &&
100
99
( tag = _ . attr ( el , 'component' ) )
101
100
) {
102
101
return tag
You can’t perform that action at this time.
0 commit comments