MiniX自绘渲染跨平台框架
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 快速上手
    • Basic 基础

    • Account

    • UI 界面

    • Device 设备

    • Bluetooth 蓝牙

    • Wifi WiFi

    • HomeManage 家庭管理

    • RoomManage 房间管理

    • Media 媒体

    • Location 定位

    • Encryption 加/解密

    • FileStorage 文件/存储

    • Http 网络/请求

    • weather 天气信息

    • Siri

    • TelPhone 电话

    • SpeechRecognition 语音识别

    • router 路由

    • integrateService 集成服务

    • baidu 百度

    • deviceConnection 设备连接

    • deviceManager 设备管理

    • share 分享

    • Cache 缓存

    • BroadcastChannel 通信通道

    • Storage 缓存(weex)

    # 安装

    # 一. 安装包

    • npm 安装
    npm i -S @minix-iot/jsbridge-sdk  或者 npm install @minix-iot/jsbridge-sdk --save
    
    
    1
    2
    • yarn 安装
    
    yarn add @minix-iot/jsbridge-sdk
    
    
    1
    2
    3
    • 升级接口模块

    • 使用 cnpm install -S + 模块name + 版本号,推荐使用 cnpm,此处使用 npm 在部分版本下有问题。

    # 升级到最新版本
    
        cnpm install -S @minix-iot/jsbridge-sdk@latest
    
    # 升级到指定版本,例如:
    
        cnpm install -S @minix-iot/jsbridge-sdk@ + 版本号
    
    # 使用0.0.12版本:
    
        cnpm install -S @minix-iot/jsbridge-sdk@0.12.0
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    • 手动修改package.json文件下的模块的版本号,然后执行以下命令:
    cnpm install(推荐)
    #或者
    npm update
    #或者
    npm install
    
    
    1
    2
    3
    4
    5
    6

    # 二. 入口文件全局挂载(app.js)

    import bridge from "@minix-iot/jsbridge-sdk";
    export default {
      bridge,
      onCreate() {
        console.info("AceApplication onCreate");
      },
      onDestroy() {
        console.info("AceApplication onDestroy");
      },
    };
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    <template>
        <div class="app">
            <input  type="button" value="返回" class="back_button" onclick="clickHandler"/>
            <text>{{message}}</text>
        </div>
    </template>
    <script>
    
    export default {
    
        data:{
            message: 'hello world'
        }
        clickHandler() {
            // 获取定位信息
            this.$app.$def.bridge.getLocation()
        }
    
    }
    </script>
    <style scoped>
    .app {
        width: 750px;
    }
    </style>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25