1

I have the following VUE component:

<template>
      <div>
          <div class="bottom-footer">  
            {{msg}}
          </div>    
      </div>
    </template>

    <script>
    export default {
      name: 'LayoutFooter',
      data () {
        return {
          msg: 'my test'
        }
      },
      mounted () {
      }
    }
    </script>

    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style scoped>
      .bottom-footer {
        height: 200px;
        background-color: #A7BFE8;
      }
    </scoped> 

VUE is completely ignoring my scoped CSS. When page is rendered its simply not applied. There are no console errors. Ive tried removing the scoped attribute and its still ignored. Any ideas why VUE is doing this?

6
  • Are you using webpack? Commented Aug 14, 2017 at 20:25
  • Yes, Im using the cli generated webpack template Commented Aug 14, 2017 at 20:25
  • Assuming you're running the dev task to automatically compile code? Commented Aug 14, 2017 at 20:26
  • Inspect the element and see what it's not what you expect. This code should (and likely does) work just fine. I'm better it's a CSS thing. Commented Aug 14, 2017 at 20:30
  • @ m.a.solano93 That's correct Commented Aug 14, 2017 at 20:31

1 Answer 1

2
<style scoped>
.bottom-footer {
height: 200px;
background-color: #A7BFE8;
}
    </style>

you need to close style

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.