💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[TOC] ### 2.组件传值 #### 父向子传 ``` 1.传值 <list-item v-for="(item, index) of list" :key="index" :content="item" :index="index" @delete="handleDelete" ></list-item> ``` ``` 2.接值 props: { index:Number, content:String }, ``` #### 子向父 ``` 1.传值 绑定事件: @click="handleClick" methods: { handleClick(){ this.$emit('delete',this.index) } }, ``` ``` 2.接值 绑定事件:@delete="handleDelete" handleDelete(index) { this.list.splice(index, 1); } ```