All Projects → bmfe → eros-widget

bmfe / eros-widget

Licence: other
eros widget is the two encapsulation for eros module.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to eros-widget

Eros
📱 一套 Vue 代码,两端原生应用 ,或许可以叫我 weex-native。
Stars: ✭ 2,007 (+15338.46%)
Mutual labels:  weex, weex-eros, eros
eros-cli
🛠️ A simple CLI for scaffolding weex projects, we provide eros-template to quickly build small and medium sized app.
Stars: ✭ 41 (+215.38%)
Mutual labels:  weex, weex-eros, eros
eros-plugin-ios-TencentCaptcha
腾讯防水墙、滑动验证、类似bilibili滑动验证码
Stars: ✭ 21 (+61.54%)
Mutual labels:  weex, weex-eros
Mypui
基于uniapp/weex,快速开发小程序和原生APP的组件库与工具集
Stars: ✭ 139 (+969.23%)
Mutual labels:  weex
Weex Start Kit
A weex + vue template to build web/Android/iOS project
Stars: ✭ 155 (+1092.31%)
Mutual labels:  weex
Weex Vue Examples
Examples of using Weex and Vue.js
Stars: ✭ 211 (+1523.08%)
Mutual labels:  weex
weex-template
A weex-template support ios android and web. dev hot-reload & can generate html & px2rem & autoprefixer.
Stars: ✭ 15 (+15.38%)
Mutual labels:  weex
Weex Amui
Ant Design Mobile of Weex
Stars: ✭ 131 (+907.69%)
Mutual labels:  weex
chameleon-sdk-ios
iOS系统下Chameleon SDK
Stars: ✭ 27 (+107.69%)
Mutual labels:  weex
Hello Weex
hello-weex包括一个Weex App(GitHub第三方App),和自己扩展的WeexiOSKit(iOS上的常用组件与模块)。
Stars: ✭ 193 (+1384.62%)
Mutual labels:  weex
Weex Vue Starter Kit
weex starter kit in vue to use weexpack & weex both.(support hot-reload)
Stars: ✭ 182 (+1300%)
Mutual labels:  weex
Weex Todo List
A demo To-do app built with Weex and Vue2.0
Stars: ✭ 159 (+1123.08%)
Mutual labels:  weex
Reactnativerollingexamples
react-native的一些example,目前支持iOS。另外收集了一份react-native学习列表
Stars: ✭ 214 (+1546.15%)
Mutual labels:  weex
Eros Template
🔧 eros app 开发模板。
Stars: ✭ 143 (+1000%)
Mutual labels:  weex
weex componets
this library is no longer maintained. For the latest gameplay, please refer to: https://github.com/fengwuxp/wuxp_common_ts_module
Stars: ✭ 16 (+23.08%)
Mutual labels:  weex
Eros Yanxuan Demo V2
📲 基于 eros 开发的 demo,迁移的自 weex 网易严选。
Stars: ✭ 139 (+969.23%)
Mutual labels:  weex
JustDo8-weex-game
🎲 a game developed using weex|使用 Weex 开发的益智类小游戏
Stars: ✭ 25 (+92.31%)
Mutual labels:  weex
Weex Droplet Ui
水滴UI一个轻量级weex UI组件库,包含表单元素,tabbar,picker城市三级联动选择,actionsheet,switch等一系列常用组件
Stars: ✭ 177 (+1261.54%)
Mutual labels:  weex
Frontend Series
📚 大前端的工程实践:iOS 篇 | Android 篇 | 混合式开发篇 - ReactNative、Weex、Weapp
Stars: ✭ 197 (+1415.38%)
Mutual labels:  weex
incubator-weex-playground
Playground for Apache Weex, demo purpose only
Stars: ✭ 43 (+230.77%)
Mutual labels:  weex

eros widget is the two encapsulation for eros module.

How to use

1.install eros-widget in eros init project.

$ npm i eros-widget -S

2.init widget in appboard js bundle.(default: config/index.js)

import widget from 'eros-Widget'

const options = {}

new widget(options)

Config options

const options = {
    router: {
        /**
         * 路由配置表
         */
        routes: {}
    },
    ajax: {
        baseUrl: 'http://app.weex-eros.com:52077',
        /**
         * 接口别名
         */
        apis: {},
        // 接口超时时间
        timeout: 30000,

        /**
         * 请求发送统一拦截器 (可选)
         * options 你请求传入的所有参数和配置
         * next
         */
        requestHandler (options, next) {
            console.log('request-opts', options)
            next()
        },
        /**
         * 请求返回统一拦截器 (可选)
         * options 你请求传入的所有参数和配置
         * resData 服务器端返回的所有数据
         * resolve 请求成功请resolve你得结果,这样请求的.then中的成功回调就能拿到你resolve的数据
         * reject 请求成功请resolve你得结果,这样请求的.then中的失败回调就能拿到你reject的数据
         */
        responseHandler (options, resData, resolve, reject) {
            const { status, errorMsg, data } = resData
            if (status !== 200) {
                console.log(`invoke error status: ${status}`)
                console.log(`invoke error message: ${errorMsg}`)
                reject(resData)
            } else {
                // 自定义请求逻辑
                resolve(data)
            }
        }
    }

router.routes: config $router.open path alias

routes: {
	'demo': {
        title: 'weex-eros demo',
        url: '/pages/demo/index.js'
    }
}

ajax.baseUrl: config you request baseUrl

ajax.apis: config you request path alias

apis: {
    'COMMON.getInfo': '/test/info/'
}

also you can config dynamic path.

apis: {
    'COMMON.getInfo': '/test/info/{plaform}/{id}'
}

and we deliver them in $get/$post params option.

this.$get({
    name: 'COMMON.getInfo',
    params: {
        platform: 'app',
        id: 3
    },
    data: {
        name: 'eros'
    }
})

finally our request url become :

ajax.baseUrl + /test/info/app/3?name=eros

ajax.timeout: request timeout time.(ms)

ajax.requestHandler: request Interceptor

ajax.responseHandler: response Interceptor

How to develop

1.init eros project.

$ eros init

2.cd your project and enter src/js

$ cd eros-demo/src/js

3.clone eros-widget.git.

$ git clone https://github.com/bmfe/eros-widget.git eros-widget

4.add config eros.dev.js alias option.

"ErosWidget": "js/eros-widget"

5.init widget in appboard js bundle.(default: config/index.js)

import ErosWidget from 'ErosWidget'

const options = {}

new ErosWidget(options)

welcome your pull request! eros loves you.

Records

1.0.1-beta.8

  • [bugfix] backAppeared 和 beforeBackAppeared 不执行的问题
  • [bugfix] pickAndUpload 成功后成功回调进入 error 回调
  • [optimize] fetch method GET POST 大小写均可

1.0.1-beta.7

  • [bugfix] $image.upload status code 判断失误

1.0.1-beta.6

  • [optimize] 重写 $bindingx 的引用方法,重写了 bind 方法,支持所有内部暴露出来的方法
  • [bugfix] 父子组件同时注册生命周期,执行两次的 bug

1.0.1-beta.3/4/5

  • [add] support bindingx.

1.0.1-beta.2

  • [bugfix] beforeAppear 和 beforeBackAppear 另个页面返回或者结束后仍会获取到上次的$router.setBackParams数据的 bug.

1.0.1-beta.1

  • [bugfix] 修复全局事件注册2次的bug

1.0.1

生命周期,自定义事件均做调整,如果不更改,请不要升级到 1.0.1

  • bmRouter 变更为 eros
  • 添加 pushMessage,可在页面中监听推送
  • 添加 appActive,可在页面中监听 app 切换到后台事件
  • 添加 appDeactive,可在页面中监听 app 切换至前台事件
  • viewWillAppear 变更为 beforeAppear,beforeBackAppear,通过打开类型来做区分
  • viewDidAppear 变更为 appearedbackAppeared,通过打开类型来做区分
  • viewWillDisappear 变更为 beforeDisappear
  • viewDidDisappear 变更为 disappeared

1.0.0

  • 从模板中抽离 widget 完成
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].