switch case vue
时间: 2023-10-18 17:59:23 浏览: 225
在Vue中,switch case语句可以用于根据不同的条件来执行不同的代码块。在你提供的代码中,switch case用于根据变量i的值返回不同的皮肤名称。根据代码的逻辑,当i的值为0时,返回'skinA',当i的值为1时,返回'skinB',当i的值为2时,返回'skinC'。这个switch case语句是Vue组件的一个方法,它可以在组件的data()方法中被调用。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [vue根据值给予不同class的实例](https://download.csdn.net/download/weixin_38592502/14823019)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [Vue 面试题( 前端开发 + Vue + 面试题 + 准备)](https://download.csdn.net/download/weixin_41784475/88219148)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [Vue项目 $set forEach+SwitchCase 免费/会员/收费课程 接口](https://blog.csdn.net/weixin_60463255/article/details/122724247)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文