安装
npm i --save imgcook-node
示例
const imgNode = const path = const co = imgNode
支持功能
输入文件支持jpg png psd 输出文件类型 支持web taro flutter 只要指定一个目录 就会自动将图片进行转换成对应平台代码
taro 转换输出
Component { return <View className=stylesbox> <View className=styleshd></View> <View className=stylesbd> <View className=styleslayerWrap> <View className=styleslayer></View> <View className=styleslargeIcon></View> </View> <View className=stylesentryPic></View> </View> <View className=stylesrow> <View className=stylespic></View> <View className=stylesitem></View> <View className=stylesimg></View> <View className=stylesitemLong></View> </View> <View className=stylessubmain> <View className=stylesproductLong></View> <View className=stylesitemLong_2></View> <View className=stylesblock> <View className=stylesentryPic_2></View> <View className=stylesentryPic_3></View> </View> </View> <View className=stylesmain></View> </View> }
web 转换输出
{ return <div className=stylesblock> <div className=styleslargeItem></div> </div> }
flutter 转换输出
class TestView extends StatefulWidget { TestView({Key key, this.navigation}) : super(key: key); final NavigationOption navigation; _TestState createState() => _TestState();} class _TestState extends State<TestView> { @override Widget build(BuildContext context) { ScreenUtil.instance = ScreenUtil(width: 750, height: 750); return View(styles: styles['block'], className: 'block', children: [ View(styles: styles['largeItem'], className: 'largeItem', children: []) ]); }} const Map<String, Styles> styles = { "block": Styles( display: "flex", alignItems: "flex-start", flexDirection: "row", borderRadius: 165, backgroundColor: "#000000", width: 750, height: 750, overflowY: "scroll", ), "largeItem": Styles( width: 750, height: 750, ),};
flutter ui 组件库介绍
rlstyles 里面有详细的参数说明
未来功能规划
这版本功能做完以后 下阶段目标为用flutter实现一个小程序内核框架目标是将现有的taro或者vue小程序项目 直接flutter跑起来可以使用小程序方式来做热更新