摘要:
定义单个Picker选项组件: import React, { useEffect, useState } from 'react' import { View, PickerView, PickerViewColumn } from '@tarojs/components' import clas 阅读全文
摘要:
封装单个picker: import React, { useState } from 'react' import { View, PickerView, PickerViewColumn } from '@tarojs/components' import classnames from 'cl 阅读全文
摘要:
// 列表整块轮播 (function ($) { FCZX.globalNamespace('FCZX.Switch'); FCZX.Switch = function (opt) { this._init(opt) } $.extend(FCZX.Switch.prototype, { isMo 阅读全文
摘要:
html: <!-- 自动轮播 start --> <div class="home-show"> <ul class="show-list"> <li class="show-item"> <a href="" style="background: url(http://pics-house.xy 阅读全文
摘要:
时间显示处理方法: // 格式化时间段 const toTimeSolt = (h: number) => { let bt = ''; if (0 <= h && h <= 3) bt = '凌晨'; if (4 <= h && h <= 8) bt = '早上'; if (9 <= h && h 阅读全文
摘要:
百度静态地图链接: export const getStaticMap = (lng: number, lat: number, zoom: number = 16) => { return `http://api.map.baidu.com/staticimage?center=${lng},${ 阅读全文
摘要:
微信小程序的image标签中有个mode属性,使用aspectFill即可 注:image组件默认宽度300px、高度225px mode 有效值: mode 有 13 种模式,其中 4 种是缩放模式,9 种是裁剪模式 mode: 'aspectFit' 的处理模式: const handleLoa 阅读全文
摘要:
使用方法: useRef && useImperativeHandle && forwardRef lodash -> isEqual 父组件: import React, { useCallback, useEffect, useMemo, useRef, useState } from 'rea 阅读全文
摘要:
父组件调用子组件方法:实现父组件滚动下拉更新分页 子组件注册方法传给父组件: useImperativeHandle(ref, () => ({ innerFn: handleScrollToLower }), [page.totalPage, param.currentPage]) const h 阅读全文
摘要:
toggleFolder 里面设置setVideos(videos)不更新,单独设置setFolder更新页面 import React, { useEffect, useState } from 'react' import { useShareAppMessage } from '@tarojs 阅读全文