import { useLoading } from '../../../behaviors/loading'; Component({ behaviors: [useLoading], options: { multipleSlots: true, // 在组件定义时的选项中启用多slot支持 }, properties: { placeholder: '输入关键词搜索', // 搜索缓存历史记录存储标签 historyTag: 'historyWords', // 搜索结果 searchResult: [], }, data: { searchValue: '', isSearch: false, historyWords: [], dialog: { title: '确认删除当前历史记录', showCancelButton: true, message: '', }, dialogShow: false, deleteType: 0, deleteIndex: '', }, lifetimes: { attached: function () { // 在组件实例进入页面节点树时执行 let optionList = optionListFunc; if (typeof optionListFunc === 'function') { optionList = optionListFunc(); } this.setSelectOptions(keyword, optionList); this.onInitialValue(keyword); }, }, methods: {}, });