App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div class="container">
  3. <category title="美食">
  4. <img src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg" alt=""/>
  5. </category>
  6. <category title="游戏">
  7. <ul>
  8. <li v-for="(g,index) in games" :key="index">{{ g }}</li>
  9. </ul>
  10. </category>
  11. <category title="电影">
  12. <video controls src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"/>
  13. </category>
  14. <!-- controls:是否展示播放按钮 -->
  15. </div>
  16. </template>
  17. <script>
  18. import Category from './components/Category.vue';
  19. export default {
  20. name: "App",
  21. components:{Category},
  22. data(){
  23. return{
  24. foods:['火锅','烧烤','小龙虾','牛排'],
  25. games:['红色警戒','穿越火线','劲舞团','超级玛丽'],
  26. films:['《教父》','《拆弹专家》','《你好,李焕英》','《尚硅谷》']
  27. }
  28. }
  29. };
  30. </script>
  31. <style>
  32. .container{
  33. display: flex;
  34. justify-content: space-around;
  35. }
  36. video{
  37. width: 100%;
  38. }
  39. </style>