// components/remotePicker/remotePicker.js import { postApi } from "../../apis/api" Component({ properties: { url: { type: String }, params: { type: Object }, inputStyle: { type: String }, scrollStyle:{ type: String }, disabled: { type: Boolean }, value: { type: String || Number }, label: { type: String }, placeholder: { type: String }, }, data: { arr: [], }, methods: { async _getList() { let res = await postApi(this.data.url, { ...this.data.params, term: this.data.label }) this.setData({ arr: res.data.result, label: '' }) }, _selectItem(e) { let { label, value } = e.currentTarget.dataset this.setData({ label, value, arr: [] }) this.triggerEvent('selectItem', { label, value }) }, _handlerOne() { this.setData({ arr: [] }) }, }, options: { styleIsolation: 'isolated' } })