UNPKG

tl-uniapp

Version:

自主开发的UniApp组件——Жидзин(triangulum-ui)系列组件库。用于组件

25 lines (21 loc) 746 B
/** x-request-config V1.0 xxx 20230215 by Sieyoo, 赵向明 */ const XCurrentSelect = {}; /** * function * @param {object} options * @param {object} value * @param {object} config * @desc 符号定义 * @return {Promise} 请求接口的返回信息 * @example 例子: */ XCurrentSelect.get = function (options, value, config = {}) { // console.log("XCurrentSelect:", options, value, config); if (!options || !options.length) return; let current = options.find(it => { return it[config ? config.value : 'value'] == value; }); // console.log("XCurrentSelect 2:", current); return (current && current[config ? config.label : 'label']) || value; }; export default XCurrentSelect;