minooo / CRA-ANTM-MOBX

create-react-app antd-mobile mobx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CRA-ANTM-MOBX

create-react-app antd-mobile mobx

#嘟嘟插件项目前端移动端模板

参考

// 开发
npm start

// 打包
npm run build

一些必要讲解的

  • 支持直接引入图片
import React from 'react';
import logo from './logo.png'; // Tell Webpack this JS file uses this image

console.log(logo); // /logo.84287d09.png

function Header() {
  // Import result is the URL of your image
  return <img src={logo} alt="Logo" />;
}

export default Header;

后端约定

以下建议是根据近期项目开发总结而来,请各位务必认真对待。有问题随时提,我们要将此作为今后的约定规范

  • 所有请求的数据统一用 data 作为键名

  • 请求数据的状态字段为 errcode(0 表示成功,其他后端商定),值类型必须为数字;消息字段为 msg,值类型必须为字符串,这俩字段每个接口都必须返回。

  • 一些极常用的约定字段关于物的标题,副标题,内容 分别为 :title, caption, con;关于人的标题,副标题,内容 分别为 :nickname (real_name, 如果需要), intro, con,产品/人物 的 id 是必须的,创建时间 created_time (其他涉及时间的,统一用 xxx_time 的格式) 手机号 mobile 地址 address 缩略图 thumb (thumb 统一用于列表中的图片字段,image(s)用于详情里的图片),头像,avatar,价格 price (优惠价:low_price) 其他字段,按需发挥,但是尽量简明扼要,统一下划线命名

About

create-react-app antd-mobile mobx


Languages

Language:CSS 51.8%Language:JavaScript 42.0%Language:HTML 6.2%