微信小程序开发和H5的开发主要区别在于标签和js部分
1、标签,微信小程序的开发很多的H5标签都是不支持的,类似H5的h1~h6,span,a,div,ul,li等等,微信小程序有它标签也叫组件。下面进行详细的解析:(注意每个属性支持的版本库)
A:view标签:基础标签,类似H5中的div,块级标签;
B: scroll-view:相当于H5中的div标签添加了overflow-x/overflow-y属性;多用于头部滑动导航,支持属性如下:
C:swiper:滑动视图容器,多用于滑动广告图,支持属性如下:
示例代码如下:
< swiper class= 'swiper' indicator-dots= 'true' indicator-color= '#fff' indicator-active-color= '#25f6d5' autoplay= 'true' circular= 'true' interval= '3000' duration= '1000' bindchange= 'change'>< swiper-item class= 'item' >< image src= '../../image/1.jpg' class= 'img'></ image ></ swiper-item >
< swiper-item class= 'item' >< image src= '../../image/2.jpg' class= 'img'></ image ></ swiper-item >
< swiper-item class= 'item' >< image src= '../../image/3.jpg' class= 'img'></ image ></ swiper-item ></ swiper >
这一章到此结束,后续会有补充,欢迎扫码支持,谢谢!