Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

<web> 组件 #80

Open
coderyi opened this issue Sep 13, 2016 · 4 comments
Open

<web> 组件 #80

coderyi opened this issue Sep 13, 2016 · 4 comments

Comments

@coderyi
Copy link

coderyi commented Sep 13, 2016

本文档已迁移至 https://weex-project.io/cn/references/components/web.html ,此处不再维护,谢谢。

<web>

英文原文

概述

web组件用来在weex页面中显示web内容。src属性用来指定一个源。你也能用webview模块来控制一些web操作比如回退、前进和重载,详见webview组件

子组件

这个组件不支持子组件。

属性

  • src: <string> 这个属性指定页面加载源

其他属性请查阅 基本属性.

样式

  • width: <length> 组件的宽度,需指定。
  • height: <length> 组件的高度,需指定。

基本样式: 查阅 基本样式

  • 支持 flexbox 相关样式
  • 支持 box 模型相关样式
  • 支持 position 相关样式

事件

  • pagestart: 发生在web组件一个页面开始加载的时候。
  • pagefinish: 发生在web组件一个页面完成加载的时候。
  • error: 发生在web组件一个页面加载失败的时候。

基本事件: 查阅 基本事件

例子

<div>
  <web style="width=...; height=...;" src="..."     onpagestart="pagestart" onpagefinish="pagefinish"   onerror="error">
  </web>
</div>
@cristaltina
Copy link

请问 可以让web的高度自适应内部子节点高度嘛?

@DoranYun
Copy link

@cristaltina web 不支持子组件

@cristaltina
Copy link

@DoranYun 目前的代码结构是
<template><div><div></div><web></web></div></template>
这样,< web >引入一个.html,而这个.html的高度不确定,想要< web >包含整个.html,所以< web >的高度也不确定,所以想知道这个问题怎么解决

@DoranYun
Copy link

本文档已迁移至 https://weex-project.io/cn/references/components/web.html ,此处不再维护,谢谢。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants