Subscribe on changes!

scoped css in self-nested component does not really "scoped".

avatar
Apr 8th 2021

Version

3.0.11

Reproduction link

https://sfc.vuejs.org/#eyJBcHAudnVlIjoiPHRlbXBsYXRlPlxuICA8U2xvdERlbW8gdWk9XCJzdHlsZTJcIj5cbiAgICA8U2xvdERlbW8gdWk9XCJzdHlsZTFcIiAvPlxuICAgIDxPdGhlckRlbW8gLz5cbiAgICA8ZGl2IGNsYXNzPVwic3R5bGUxIHN0eWxlMlwiPlxuICAgICAgPHNwYW4gY2xhc3M9XCJ0aXRsZVwiPmlubGluZSBzdHlsZSBpcyBvazwvc3Bhbj5cbiAgICA8L2Rpdj5cbiAgPC9TbG90RGVtbz5cblxuICA8U2xvdERlbW8gdWk9XCJzdHlsZTFcIiAvPlxuPC90ZW1wbGF0ZT5cblxuPHNjcmlwdD5cbmltcG9ydCBTbG90RGVtbyBmcm9tIFwiLi9TbG90RGVtby52dWVcIjtcbmltcG9ydCBPdGhlckRlbW8gZnJvbSBcIi4vT3RoZXJEZW1vLnZ1ZVwiO1xuZXhwb3J0IGRlZmF1bHQge1xuICBjb21wb25lbnRzOiB7XG4gICAgU2xvdERlbW8sXG4gICAgT3RoZXJEZW1vXG4gIH1cbn1cblxuPC9zY3JpcHQ+IiwiT3RoZXJEZW1vLnZ1ZSI6Ijx0ZW1wbGF0ZT5cbiAgPGRpdiBjbGFzcz1cInN0eWxlMSBzdHlsZTJcIj5cbiAgICA8ZGl2IGNsYXNzPVwidGl0bGVcIj5vdGhlciBjb21wb25lbnQgaXMgb2s8L2Rpdj5cbiAgPC9kaXY+XG48L3RlbXBsYXRlPiIsIlNsb3REZW1vLnZ1ZSI6Ijx0ZW1wbGF0ZT5cbiAgPHNlY3Rpb24gOmNsYXNzPVwidWlcIj5cbiAgICA8ZGl2IGNsYXNzPVwidGl0bGVcIj57eyB1aSB9fSBmb250LXNpemUge3sgZm9udFNpemUgfX08L2Rpdj5cbiAgICA8c2xvdD5zZWxmIG5lc3RlZCBjb21wb25lbnQuIGluc3RhbmNlJ3N0eWxlIHNob3VsZCBiZSBkaXN0dXJiZWQgYnkgaXQncyBwYXJlbnQ/PC9zbG90PlxuICA8L3NlY3Rpb24+XG48L3RlbXBsYXRlPlxuXG48c2NyaXB0PlxuZXhwb3J0IGRlZmF1bHQge1xuICBwcm9wczoge1xuICAgIHVpOiB7XG4gICAgICB0eXBlOiBTdHJpbmcsXG4gICAgICBkZWZhdWx0OiBcInN0eWxlMVwiIC8vIHN0eWxlMSBvciBzdHlsZTJcbiAgICB9XG4gIH0sXG4gIGRhdGEoKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgIGZvbnRTaXplOiB7IFwic3R5bGUxXCI6IFwiMjRweFwiLCBcInN0eWxlMlwiOiBcIjM2cHhcIiB9W3RoaXMudWldXG4gICAgfVxuICB9XG59XG48L3NjcmlwdD5cblxuPHN0eWxlIHNjb3BlZD5cbi50aXRsZSB7XG4gIGZvbnQtc2l6ZTogMTRweDtcbiAgZm9udC13ZWlnaHQ6IDcwMDtcbn1cbi5zdHlsZTEgLnRpdGxlIHtcbiAgZm9udC1zaXplOiAyNHB4O1xufVxuLnN0eWxlMiAudGl0bGUge1xuICBmb250LXNpemU6IDM2cHg7XG59XG5cbjwvc3R5bGU+In0=

Steps to reproduce

  • set self-nested compoent in it's default slot.
  • parent style effect to it's instance in the slot.

What is expected?

self-nested component in the slot should not disturbed by it's parent by default.

What is actually happening?

self-nested component in the slot effected by it's parent style.


I'm writing a visual component toolbox, in which the container component is a self nested component.

avatar
Apr 8th 2021

This seems to be working as expected, unless you want to be more explicit about what is expected in terms of style and what is happening.