| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- // components/remotePicker/remotePicker.js
- import {
- postApi
- } from "../../apis/api"
- Component({
- properties: {
- url: {
- type: String
- },
- params: {
- type: Object
- }
- },
- data: {
- arr: [],
- value: '',
- label: '',
- },
- methods: {
- async getList() {
- let res = await postApi(this.data.url, {
- ...this.data.params,
- term: this.data.label
- })
- this.setData({
- arr: res.data.result
- })
- console.log(res)
- },
- selectItem(e) {
- let {
- label,
- value
- } = e.currentTarget.dataset
- this.setData({
- label,
- value,
- arr: []
- })
- }
- }
- })
|