Code Monkey home page Code Monkey logo

taro_scaffold's Introduction

我的 Taro 小程序脚手架

文档参考

https://nervjs.github.io/taro

关于 sprite

由于 Taro 目前已知尚未支持 sprite ,如果需要的话,就可以直接使用 gulp 开启一个 sprite 任务。

yarn spwatch : 监控形式的 sprite 任务。

yarn spbuild : 打包形式的 sprite 任务。

sprite 图片存放路径

放在 src/sprites 下面,里面的 src/sprites/_sprites.scss 为基础的模板。

sprite 临时文件

  • 位于 src/.sprites 文件夹。
  • sprites-base64.scss 为 base64 的背景图存放信息。
  • sprites.scss 为 sprites 输出的 scss 。
  • sprites.png 为合并之后的 sprites 图,sprites-base64.scss 生成之后就没使用了。

项目 scripts

  • yarn start , 这个会直接开启 sprite 和 taro 的开发任务
  • yarn release , 打包的,会包含 sprite 以及 taro 的打包语法一起打包。
  • package.json 中其他 scripts 指令,和 taro 或者其他相同。可以试一下。

如何使用

  • clone
  • yarn && bower install
  • 随便自己想怎么改怎么改动
  • 如果有需求,欢迎提 issue ,我会考察之后进行增加
  • 第三方组件使用 bower 管理,存放在 src/bower 里面,运行前使用先 bower install(确保本地已经安装 bower)

tags

-v0.5.0:

  • taro 升级到 1.2.1
  • 删除 pages/index 中 render 之外的 jsx 渲染的调用例子代码(不支持的)
  • v0.4.0: (忘了打的感觉)
    • taro 升级到 0.0.73 -> 1.0.0-beta.4 -> 1.0.0-beta.6
    • 增加组件的引用例子(组件名必须和使用时候的名字一致)
    • 增加 iview 等第三方组件使用的例子(使用 bower 管理组件)
    • 分离首页的例子到单独每个页面
  • v0.3.0: 加入 wxs 的说明,以及 js 和 jsx 中导入的不同情况例子。(尚未支持 iview)
  • v0.2.0: 加入了 sprites
  • v0.1.3: 改用 axios
  • v0.1.2: 使用 dva 的 redux 模式进行处理
  • v0.1.1/v0.1.0: Taro 初始化

taro_scaffold's People

Contributors

shenqihui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

sunxiuguo

taro_scaffold's Issues

model内部文件报错

`错误 编译失败 src/models/global.ts
{ SyntaxError: unknown: Unexpected token, expected ";" (127:18)

125 |
126 |

127 | yield put({
| ^
128 | type: 'SET_DATA',
129 | payload: {
130 | windowWidth: res.windowWidth,
at _class.raise (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:3893:15)
at _class.unexpected (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:5222:16)
at _class.semicolon (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:5206:40)
at _class.parseExpressionStatement (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:7635:10)
at _class.parseExpressionStatement (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:9914:69)
at _class.parseStatementContent (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:7234:19)
at _class.parseStatementContent (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:9850:58)
at _class.parseStatement (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:7115:17)
at _class.parseBlockOrModuleBlockBody (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:7666:23)
at _class.parseBlockBody (/Users/zsz/Desktop/taro-wechat-demo/node_modules/@babel/parser/lib/index.js:7653:10)
pos: 3076,
loc: Position { line: 127, column: 18 },
code: 'BABEL_PARSE_ERROR' }`

使用npm不使用本地的dva-core 文件会报错

VM4987:1 thirdScriptError sdk uncaught third Error module "npm/core-js/library/fn/object/get-own-property-descriptor.js" is not defined Error: module "npm/core-js/library/fn/object/get-own-property-descriptor.js" is not defined at require (http://127.0.0.1:44596/appservice/__dev__/WAService.js:22:20138) at http://127.0.0.1:44596/appservice/__dev__/WAService.js:22:19993 at http://127.0.0.1:44596/appservice/npm/@babel/runtime/core-js/object/get-own-property-descriptor.js:1:328

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.