jfroum部分配置
1:modulesMapping配置
访问名=com.xx包.xx方法
2:urlPattern.properties配置
访问名.方法.方法返回的参数=
3:templatesMapping.properties配置
设置指向名=指向的网页
4:访问
this.setTemplateName("设置指向名");
5:页面传值
this.context.put("infos", infos);
6:获取页面值
this.request.getIntParameter("test_prise")
//根据你自己的实际数据类型
7:js原生访问
var host = window.location.host;
url=“http://”?/+host+"/访问名/方法"
function 方法名() {
var url = "http://" + host + "/accusation/getAccusationList/"+".html";
document.getElementById('form1').setAttribute('action',url);
document.getElementById('form1').submit();
}
react native(基本语法)
export default class BlankApp extends Component{
constructor(props){
super(props);
}
render() {
return (
你的代码块
);
}
}
css样式写法 与js中的样式写法一致
1:外部样式(每个样式需要用,号隔开)
const styles=StyleSheet.create({
样式名:{
样式一,
},
})
引用:style={styles.样式名}
2:内部样式
style={{width: 66, height: 58,backgroundColor:"#fff",}}
3:字体样式颜色在内部中使用backgroundColor:"#fff"外部则需要改成color:"#fff",
4:所有px像素不用‘’或“”但百分比则需要加“”以及px单位
5:View代替div标签
6:内容必须使用<Text></Text>
标签引用
7:图片
<Image
style={styles.main_count_img_div_img}
source={{uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
/>
style 设置样式 source为图片路径
8:去除浮动样式 布局
flexWrap:'wrap',
flexDirection:'row',
当超出部分会自动换行
9:margin样式去除“0 auto”的写法
其居中可以采用
垂直居中justifyContent: 'center'
水平居中alignItems: 'center'
布局参考https://www.cnblogs.com/axl234/p/5611467.html
https://blog.csdn.net/quanqinyang/article/details/52215641
部分样式参考
https://www.cnblogs.com/the-artist/p/9792131.html
react native 中文文档
https://reactnative.cn/docs/getting-started/
react-native实例代码(webStorm)编写
import React,{Component} from 'react';
import {Alert,StyleSheet,Image,TextInput,Button,Text,View}from'react-native';
import * as ListView from "react-native";
export default class BlankApp extends Component{
constructor(props){
super(props);
}
render() {
return (
<View style={ styles.main}>
<View style={ styles.main_count}>
<View style={styles.main_count_img_div}>
<Image
style={styles.main_count_img_div_img}
source={{uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
/>
</View>
<View style={styles.count_info_div}>
<Text style={styles.info_name}>小米手机9</Text>
<Text style={styles.info_prise}>¥9999元</Text>
</View>
<View style={styles.other_info_div}>
<Text style={styles.other_info}>好用得很嘛</Text>
</View>
</View>
<View style={ styles.main_count}>
<View style={styles.main_count_img_div}>
<Image
style={styles.main_count_img_div_img}
source={{uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
/>
</View>
<View style={styles.count_info_div}>
<Text style={styles.info_name}>小米手机9</Text>
<Text style={styles.info_prise}>¥9999元</Text>
</View>
<View style={styles.other_info_div}>
<Text style={styles.other_info}>好用得很嘛</Text>
</View>
</View>
<View style={ styles.main_count}>
<View style={styles.main_count_img_div}>
<Image
style={styles.main_count_img_div_img}
source={{uri: 'https://facebook.github.io/react-native/docs/assets/favicon.png'}}
/>
</View>
<View style={styles.count_info_div}>
<Text style={styles.info_name}>小米手机9</Text>
<Text style={styles.info_prise}>¥9999元</Text>
</View>
<View style={styles.other_info_div}>
<Text style={styles.other_info}>好用得很嘛</Text>
</View>
</View>
</View>
);
}
}
const styles=StyleSheet.create({
main:{
flexWrap:'wrap',
flexDirection:'row',
backgroundColor:"#eee",
height:'auto',
},
main_count:{
width:'49%',
height:255,
backgroundColor:"#fff",
margin:1,
marginLeft:3,
},
main_count_img_div:{
width:'80%',
height:160,
marginLeft:'10%',
marginTop:10,
},
main_count_img_div_img:{
width:'100%',
height:160,
},
count_info_div:{
width:'100%',
height:30,
marginTop:5,
},
info_name:{
fontSize:20,
color:"#2b2b2b",
fontFamily:"微软雅黑",
paddingLeft:4,
},
info_prise:{
color:"#ff1a1e",
marginLeft:'70%',
marginTop:-20,
},
other_info_div:{
width:'100%',
height:10,
marginTop:5,
},
other_info:{
fontSize:18,
color:"#2b2b2b",
fontFamily:"微软雅黑",
paddingLeft:4,
} ,
});