Giter Club home page Giter Club logo

taro-v2ex's Introduction

Taro-V2EX

这个项目使用了 Taro 构建了一个 V2ex 论坛小程序。主要目的在于展示如何使用 TypeScript 构建 Taro 项目和使用内置的事件中心跨组件/路由传递消息。

v2ex.gif

运行

$ npm install
$ npm i -g @tarojs/cli
$ taro build --type weapp --watch

限制

宥于 V2EX API 的限制,本项目有几个限制:

  1. 没有「获取更多」的这个 API,除了回复可以全部载入之外所有 API 都不能加载更多信息;
  2. 每个 IP 每小时只能访问 API 100 次,超过便无法访问;
  3. 无法跨域,因此没有 h5 版本;

建议

对于在 Taro 中使用 TypeScript 有一些建议:

  • 使用 tslint 作为编辑器内置的 linter
  • 使用 eslint 命令行工具配合 typescript-eslint-parsereslint-config-taro(见 .eslintrc) 作为 precommit 或者 prepush 的钩子,在提交或 commit 或编译出现问题时检查代码是否符合 Taro 规范
  • 不要在 TypeScript 使用 Redux 的 connect 装饰器,使用普通的函数写法,详情见: #9951
  • 当你的项目不那么复杂时,可以不使用 Redux

taro-v2ex's People

Contributors

chen-jj avatar hephaest avatar luckyadam avatar yuche 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

taro-v2ex's Issues

vue 不可用

react版能正常构建,vue版在npm install时即报错,找不到Python路径,本机事实上安装了Python3.9,查看系统变量也设置了相关路径。

想问下this.$router是哪里来的?

我目前基于最新的3.0.8的版本改造这个项目,但是node_detail.tsx中的$router是从哪里来的? 谢谢。

componentWillMount() {
    const { full_name } = this.$router.params; // 我不太懂这个$router是怎么来的,前端会报错
    Taro.setNavigationBarTitle({
      title: decodeURI(full_name),
    });
  }

[Bug] React: 无法启动微信小程序

Summary

yarn dev:weapp 时报错

👽 Taro v3.6.8

找不到插件依赖 "@tarojs/plugin-framework-react",请先在项目中安装,项目路径:/Users/hephaest/taro-v2ex
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build:weapp: `taro build --type weapp "--watch"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] build:weapp script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Expected Behavior

无报错

Environment Information

Package Name Package Version
node 14.18.3
@tarojs/taro 3.6.8

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.