多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[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 + "获取服务分组失败"); } }, // ... } ~~~