let mySwiper = null // 每一个页面都应该有一个init方法 // 用来做初始化 const init = async () => { footer() getTagRecommend() getHomeBanner() getHomeHot() getHomeList() } const getHomeBanner = async () => { innerMaps( ".swiper-wrapper", await homeBanner(), v => `
` ) initSwiper(); } const getTagRecommend = async () => { innerMaps( ".recommend-tag", await tagRecommend(), v => `
  • ${v.short_title}
    ${v.title}
  • ` ) } const getHomeHot= async () => item(".roll ul",await homeHot()) const getHomeList = async () => item(".random ul", await homeList()) const initSwiper = () => { mySwiper = new Swiper('.banner', { loop: true, // 循环模式选项 // 如果需要分页器 pagination: { el: '.swiper-pagination', }, }) } init()