search

Home  >  Q&A  >  body text

css - The scoped attribute in the vue single file component style of vue.js is invalid

RT, I clearly wrote <style scoped> in a.vue and b.vue, but modifying the p.warp style in a.vue affects the p.warp style in b.vue. Could you please explain this? what's going on?

My webpack is directly using the webpack template in vue-cli, and I have never modified anything.

我想大声告诉你我想大声告诉你2801 days ago981

reply all(5)I'll reply

  • phpcn_u1582

    phpcn_u15822017-05-16 13:25:48

    Upload the code. You may not be able to see anything with the code. You may not be able to see anything without the code

    reply
    0
  • 天蓬老师

    天蓬老师2017-05-16 13:25:48

    Have you written this for both a.vue and b.vue?

    reply
    0
  • 为情所困

    为情所困2017-05-16 13:25:48

    Browser debugging takes a look at the final style selector

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-16 13:25:48

    Same question, I also encountered this problem, vue-cli is not moved. After adding socped, v-data- is added to the element, but style is not, so there will still be a conflict

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-16 13:25:48

    Add !important

    after your CSS

    reply
    0
  • Cancelreply