@@ -81,8 +81,7 @@ function processRule(id: string, rule: Rule) {
8181function rewriteSelector (
8282 id : string ,
8383 selector : selectorParser . Selector ,
84- selectorRoot : selectorParser . Root ,
85- slotted = false
84+ selectorRoot : selectorParser . Root
8685) {
8786 let node : selectorParser . Node | null = null
8887 let shouldInject = true
@@ -142,23 +141,22 @@ function rewriteSelector(
142141 return false
143142 }
144143
145- // slot: use selector inside `::v-slotted` and inject [id + '-s']
146- // instead.
144+ // !!! Vue 2 does not have :slotted support
147145 // ::v-slotted(.foo) -> .foo[xxxxxxx-s]
148- if ( value === ':slotted' || value === '::v-slotted' ) {
149- rewriteSelector ( id , n . nodes [ 0 ] , selectorRoot , true /* slotted */ )
150- let last : selectorParser . Selector [ 'nodes' ] [ 0 ] = n
151- n . nodes [ 0 ] . each ( ss => {
152- selector . insertAfter ( last , ss )
153- last = ss
154- } )
155- // selector.insertAfter(n, n.nodes[0])
156- selector . removeChild ( n )
157- // since slotted attribute already scopes the selector there's no
158- // need for the non-slot attribute.
159- shouldInject = false
160- return false
161- }
146+ // if (value === ':slotted' || value === '::v-slotted') {
147+ // rewriteSelector(id, n.nodes[0], selectorRoot, true /* slotted */)
148+ // let last: selectorParser.Selector['nodes'][0] = n
149+ // n.nodes[0].each(ss => {
150+ // selector.insertAfter(last, ss)
151+ // last = ss
152+ // })
153+ // // selector.insertAfter(n, n.nodes[0])
154+ // selector.removeChild(n)
155+ // // since slotted attribute already scopes the selector there's no
156+ // // need for the non-slot attribute.
157+ // shouldInject = false
158+ // return false
159+ // }
162160
163161 // global: replace with inner selector and do not inject [id].
164162 // ::v-global(.foo) -> .foo
@@ -184,14 +182,13 @@ function rewriteSelector(
184182 }
185183
186184 if ( shouldInject ) {
187- const idToAdd = slotted ? id + '-s' : id
188185 selector . insertAfter (
189186 // If node is null it means we need to inject [id] at the start
190187 // insertAfter can handle `null` here
191188 node as any ,
192189 selectorParser . attribute ( {
193- attribute : idToAdd ,
194- value : idToAdd ,
190+ attribute : id ,
191+ value : id ,
195192 raws : { } ,
196193 quoteMark : `"`
197194 } )
0 commit comments