1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <template>
- <div class="container">
- <category title="游戏">
- <!-- 必须用template包裹,并且配置scope,scope的名字可以随意定 -->
- <template scope="atguigu">
- <ul>
- <li v-for="(g,index) in atguigu.games" :key="index">{{ g }}</li>
- </ul>
- </template>
- </category>
- <category title="游戏">
- <template scope="{games}">
- <ol>
- <li v-for="(g,index) in games" :key="index">{{ g }}</li>
- </ol>
- </template>
- </category>
- <category title="游戏">
- <template slot-scope="{games}">
- <h4 v-for="(g,index) in games" :key="index">{{ g }}</h4>
- </template>
- </category>
- </div>
- </template>
- <script>
- import Category from './components/Category.vue';
-
- export default {
- name: "App",
- components:{Category},
- };
- </script>
- <style>
- .container,.foot{
- display: flex;
- justify-content: space-around;
- }
- video{
- width: 100%;
- }
- h4{
- text-align: center;
- }
- </style>
|