App.vue 525 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div id="app">
  3. <h2 class="css_title">{{msg}}</h2>
  4. <router-link to="/home">首页</router-link>
  5. <router-link to="/news">新闻</router-link>
  6. <hr>
  7. <router-view></router-view>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: 'app',
  13. data() {
  14. return {
  15. msg: "hello world!",
  16. title1: "测试",
  17. }
  18. },
  19. methods: {
  20. }
  21. }
  22. </script>
  23. <style lang="scss" scoped>
  24. /*css 局部作用域 scoped*/
  25. #app {
  26. .css_title {
  27. color: red;
  28. }
  29. .css_title2 {
  30. color: #008000;
  31. }
  32. }
  33. </style>