💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、豆包、星火、月之暗面及文生图、文生视频 广告
[TOC] ## 1.搜索输入框搜索功能 >[success] tips:只在输入框值更改,且为新的值时请求数据 ~~~ handleInputChange(value) { const newVal = value.trim(); if (newVal !== this.lastVal) { this.lastVal = newVal; this.$emit("onInputChange", newVal); } } ~~~ ## 2.使用vuex保存常用数据 >[success] 通过使用actions异步请求数据提交保存至store.state中,方便其他页面、组件获取 ~~~ actions: { async saveServiceGroup({ commit }) { try { const res = await getServiceGroup(); let group = []; if (res && res.data) { commit("saveServiceGroup", res.data); } } catch (error) { console.error(error + "获取服务分组失败"); } }, // ... } ~~~