const AppStackLog = createDrawerNavigator(
{
Login: {
screen: LogintStack,
navigationOptions: (navOpt) => ({
drawerLabel: ({focused}) =>(
<TouchableOpacity style={[styles.button]} onPress={() => this.navigation.navigate('App')}>
<Text><Icon
size={17}
name="log-in"
family="Galio"
color={focused ? 'white' : materialTheme.COLORS.MUTED} />
<Text size={18}> Logout</Text></Text>
</TouchableOpacity>
),
}),
},
},
Menu
);
export default createSwitchNavigator(
{
App: AppStack,
Home: HomeStack,
Auth:AppStackLog,
},
{
initialRouteName: 'App',
}
);
答案 0 :(得分:0)
let pdf = new jsPDF('p', 'pt', 'a4');
let left = 36; // narrow margin - 12.7 mm
let srcwidth = document.getElementById('html').style.width;
let scale = (595.28 - left * 2) / Math.ceil(srcwidth.replace('px','')); // a4 pageSize 595.28
pdf.html(document.getElementById('html'), {
html2canvas: {
scale: scale // default is window.devicePixelRatio,
},
x: left,
y: 36,
callback: function () {
window.open(pdf.output('bloburl'));
}
});
不会指向某个特定的组件,而是指向this
等于定义此代码时的任何内容。相反,navOpt参数具有您所需要的:
this