Git Product home page Git Product logo

harmonyos-shell's Introduction

harmonyos-shell

简介

harmonyos-shell包含一个定制化的TaroWebContainer实现,旨在为Taro工程的harmony-hybrid平台产物提供运行环境。同时提供Sample例程演示如何使用该容器。

使用

  • 根据Taro官方文档,把Taro工程编译成harmony-hybrid平台应用
  • 把生成产物放置到Sample/src/main/resources/rawfile目录下
  • 编译运行Sample应用

使用示例

// Sample/src/main/ets/pages/Index.ets
import { TaroWebContainer, InjectObject, HostPageState, TaroWebController } from '@ohos/web-container';
...
@Entry(storage)
@Component
struct TaroMpharmonySample {
  ...
  build() {
    Column() {
      TaroWebContainer({
        indexHtmlPath: 'index.html',
        pageState: this.pageState, // 页面状态同步到组件
        webUrl: this.webUrl(), // 初始Url
        webUrlPrefix: this.webUrlPrefix(),
        useCache: true, // 使用缓存资源
        want: this.want, // want信息
        taroWebController: this.taroWebController,
        isFullScreen: false, // 是否全屏显示
        injectObj: this.nativeObj, // 注入对象
        navigationInitVisible: true, // 导航栏是否显示
        forceDarkAccess: true
      })
        .width('100%')
        .height('100%')
    }
  }
}

harmonyos-shell's People

Contributors

guoenxuan avatar 58liuyang avatar chenai02 avatar jiangfeng52 avatar handsomeliuyang avatar qican777 avatar tangcq-code avatar heweishui avatar xiaoyan428820 avatar kongxiaojun avatar shan8545 avatar adewu avatar licunhao1 avatar qcjxs avatar wangzhenhuione avatar pzx-00100 avatar secondone21 avatar jasonzhang9 avatar

Stargazers

正平 avatar

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.