@@ -465,14 +465,28 @@ function processOnce (el) {
465
465
466
466
function processSlot ( el ) {
467
467
if ( el . tag === 'slot' ) {
468
- el . slotName = getBindingAttr ( el , 'name' )
469
- if ( process . env . NODE_ENV !== 'production' && el . key ) {
470
- warn (
471
- `\`key\` does not work on <slot> because slots are abstract outlets ` +
472
- `and can possibly expand into multiple elements. ` +
473
- `Use the key on a wrapping element instead.`
474
- )
468
+ let slotName
469
+ slotName = getBindingAttr ( el , 'name' )
470
+ if ( process . env . NODE_ENV !== 'production' ) {
471
+ if ( el . key ) {
472
+ warn (
473
+ `\`key\` does not work on <slot> because slots are abstract outlets ` +
474
+ `and can possibly expand into multiple elements. ` +
475
+ `Use the key on a wrapping element instead.`
476
+ )
477
+ }
478
+ if ( slotName ) {
479
+ const res = parseText ( slotName , delimiters ) ;
480
+ if ( res ) {
481
+ warn (
482
+ `name="${ slotName } ": ` +
483
+ `Interpolation on <slot> "name" attribute has been removed. ` +
484
+ `Use v-bind or the colon shorthand instead.`
485
+ )
486
+ }
487
+ }
475
488
}
489
+ el . slotName = slotName
476
490
} else {
477
491
let slotScope
478
492
if ( el . tag === 'template' ) {
@@ -502,6 +516,14 @@ function processSlot (el) {
502
516
}
503
517
const slotTarget = getBindingAttr ( el , 'slot' )
504
518
if ( slotTarget ) {
519
+ const res = parseText ( slotTarget , delimiters ) ;
520
+ if ( process . env . NODE_ENV !== 'production' && res ) {
521
+ warn (
522
+ `slot="${ slotTarget } ": "` +
523
+ `Interpolation on "slot" attribute has been removed. ` +
524
+ `Use v-bind or the colon shorthand instead.`
525
+ ) ;
526
+ }
505
527
el . slotTarget = slotTarget === '""' ? '"default"' : slotTarget
506
528
// preserve slot as an attribute for native shadow DOM compat
507
529
// only for non-scoped slots.
0 commit comments