App.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="container">
  3. <category title="美食">
  4. <img slot="center" src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg" alt=""/>
  5. <a slot="footer" href="www.baidu.com">更多美食</a>
  6. </category>
  7. <category title="游戏">
  8. <ul slot="center">
  9. <li v-for="(g,index) in games" :key="index">{{ g }}</li>
  10. </ul>
  11. <div class="foot" slot="footer">
  12. <a href="www.baidu.com">单机游戏</a>
  13. <a href="www.baidu.com">网络游戏</a>
  14. </div>
  15. </category>
  16. <category title="电影">
  17. <video slot="center" controls src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"/>
  18. <template v-slot:footer>
  19. <div class="foot">
  20. <a href="www.baidu.com">经典</a>
  21. <a href="www.baidu.com">热门</a>
  22. <a href="www.baidu.com">推荐</a>
  23. </div>
  24. <h4>欢迎前来观看</h4>
  25. </template>
  26. </category>
  27. <!-- controls:是否展示播放按钮 -->
  28. </div>
  29. </template>
  30. <script>
  31. import Category from './components/Category.vue';
  32. export default {
  33. name: "App",
  34. components:{Category},
  35. data(){
  36. return{
  37. foods:['火锅','烧烤','小龙虾','牛排'],
  38. games:['红色警戒','穿越火线','劲舞团','超级玛丽'],
  39. films:['《教父》','《拆弹专家》','《你好,李焕英》','《尚硅谷》']
  40. }
  41. }
  42. };
  43. </script>
  44. <style>
  45. .container,.foot{
  46. display: flex;
  47. justify-content: space-around;
  48. }
  49. video{
  50. width: 100%;
  51. }
  52. h4{
  53. text-align: center;
  54. }
  55. </style>