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) {
245245 }
246246 // check component
247247 if ( ! linkFn ) {
248- linkFn = checkComponent ( el , options )
248+ linkFn = checkComponent ( el , options , hasAttrs )
249249 }
250250 // normal directives
251251 if ( ! linkFn && hasAttrs ) {
@@ -573,11 +573,12 @@ function checkElementDirectives (el, options) {
573573 *
574574 * @param {Element } el
575575 * @param {Object } options
576+ * @param {Boolean } hasAttrs
576577 * @return {Function|undefined }
577578 */
578579
579- function checkComponent ( el , options ) {
580- var componentId = _ . checkComponent ( el , options )
580+ function checkComponent ( el , options , hasAttrs ) {
581+ var componentId = _ . checkComponent ( el , options , hasAttrs )
581582 if ( componentId ) {
582583 var componentLinkFn = function ( vm , el , host ) {
583584 vm . _bindDir ( 'component' , el , {
Original file line number Diff line number Diff line change @@ -48,13 +48,6 @@ function enableDebug () {
4848 exports . assertAsset = function ( val , type , id ) {
4949 /* istanbul ignore if */
5050 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- }
5851 if ( id === 'with' ) {
5952 exports . warn (
6053 'v-with has been deprecated in ^0.12.0. ' +
@@ -74,4 +67,4 @@ function enableDebug () {
7467 exports . warn ( 'Failed to resolve ' + type + ': ' + id )
7568 }
7669 }
77- }
70+ }
Original file line number Diff line number Diff line change @@ -77,13 +77,12 @@ function formatValue (val) {
7777 *
7878 * @param {Element } el
7979 * @param {Object } options
80+ * @param {Boolean } hasAttrs
8081 * @return {String|undefined }
8182 */
8283
8384exports . 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 ) {
8786 var tag = el . tagName . toLowerCase ( )
8887 if ( tag === 'component' ) {
8988 // dynamic syntax
@@ -96,7 +95,7 @@ exports.checkComponent = function (el, options) {
9695 ) {
9796 return tag
9897 } else if (
99- exports . tableElementsRE . test ( tag ) &&
98+ hasAttrs &&
10099 ( tag = _ . attr ( el , 'component' ) )
101100 ) {
102101 return tag
You can’t perform that action at this time.
0 commit comments