import { Component } from "react"; import Taro from "@tarojs/taro"; import { View, Text, Image, Button } from "@tarojs/components"; import "./index.scss"; import { AtTabBar } from "taro-ui"; import React, { useCallback, useEffect, useState } from "react"; import { AtGrid } from "taro-ui"; import { Swiper, SwiperItem } from "@tarojs/components"; import { AtCard } from "taro-ui"; import { AtImagePicker } from "taro-ui"; import { AtButton } from "taro-ui"; import { AtSearchBar } from "taro-ui"; import { Picker } from "@tarojs/components"; import { AtList, AtListItem, AtNavBar, AtTag, AtMessage } from "taro-ui"; import { AtModal, AtModalHeader, AtModalContent, AtModalAction, AtAvatar, AtAccordion, } from "taro-ui"; import { AtToast } from "taro-ui"; import { AtIcon } from "taro-ui"; import { VIEW } from "@tarojs/runtime"; import "animate.css"; import beijing from "../../images/beijing.jpg"; import shanghai from "../../images/shanghai.jpg"; import shenzhen from "../../images/shenzhen.jpg"; // export default class Index extends Component { const Index = () => { const [current, setcurrent] = useState(0); const custDom = () => { return custDom; }; return ( {/* 数组尽量是4的倍数 */} {[ { img: beijing, type: "item", dom: "" }, { img: shanghai, type: "item", dom: "" }, { img: shenzhen, type: "custom", dom: custDom() }, { img: shenzhen, type: "item", dom: "" }, ].map((item, index) => { if (item.type === "custom") { return {item.dom}; } else { return ( itemUp itemiddle itemDown ); } })} {/* 22 */} ); }; export default Index;