微信小程序 组件
组件
-
所有组件与属性都是<mark>小写</mark>,以连字符 - 链接
如:cover-image :覆盖在原生组件之上的图片视图
-
视图组件:
view 属性 hover-class,hover-start-time,
hove-stay-time,hover-stop-propagation=‘{ {true}}’是否阻止冒泡
swiper:滑块视图容器,其中只可放置swiper-item组件,否则会导致未定义的行为
swiper-view:可滚动视图区域。使用时必须给swiper-view高度
scroll-x ,scroll-y 横轴,纵轴滚动
-
富文本 rich-text 与v-html作用类似
-
form
提交必须是button form-type为submit
<form bindsubmit="xxx"></form>
-
导航
-
组件的方式:navigator 页面链接。
url=’/pages/cq/cq’
-
Open-type:页面跳转方式
- navigate 不关闭当前页面,跳转到另一个页面(不能跳转到tab页面)
- switchTab: 跳转到 tabBar 页面,并关闭其他所有非 tabBar 页面
- redirect:关闭当前页面,跳转到另一个页面,(不能跳转到tabBar页面)
-
传参url=’/pages/cq/cq?name=“liu”&age=23
<navigator url='/pages/cq/cq?name="liu"&age=23 open-type="redirect"> <button>跳转</button> </navaigator>
-
接参:
onLoad:function(options){ console.log(options) // {name:'liu',age:23} }
-