#跳转到目的页面,打开新页面
Taro.navigateTo({ url: '/pages/page/path/name'})
#跳转到目的页面,在当前页面打开
Taro.redirectTo({ url: '/pages/page/path/name'})
#传参'/pages/page/path/name?id=2&type=test'
#得到路由参数this.$router.params
#静态资源的引用
import namedPng from '../../images/path/named.png'
// 使用<View> <Imagesrc={namedPng}/></View>
import './test.less'
<Image className='img' src={Img}/>
.img{
width:100%;
margin-top:50PX;//(px小写会转为rem大写就还是PX
}
##taro中阻止事件冒泡event.stopPropagation
##任何组建的事件传递都要以on开头(适配小程序)
###事件传递参数的时候,event一般在参数后面
可通过函数console.log(arguments),第一项是参数,第二项是event
网友评论