test(...arg) { console.log("參數(shù)",arg); } render(){ return <View style={{flex:1,backgroundColor:"blue"}}> <TouchableOpacity activeOpacity={1} onPress={this. test("點(diǎn)擊執(zhí)行這個函數(shù)而不是立即執(zhí)行")}>//不適用箭頭函數(shù) 有沒有其他方式呢? <Text>hahahahhahahahahahha</Text> </TouchableOpacity> </View> }
ES6中不用匿名函數(shù)如何傳遞參數(shù),而且不立即執(zhí)行呢
胡子哥哥
2019-03-11 11:12:11