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

<image>组件 #44

@Erwin11

Description

@Erwin11

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

< image > 组件

概述

image 标签用于渲染一个特定的图片,并且它不能包含任何子组件。可以用img 作简写。

注意: widthheight需要指定,否则会不工作。

简写:

子组件

这个组件不支持子组件。

属性

  • src:<字符串>属性 图片原始链接
  • resize: <字符串> 组件的拉伸属性。默认值是stretch,如果此属性不指定,该值可能是cover,contain , 值行为和W3C标准一致。

其他属性请查阅基本属性

样式

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

基本样式: 查看基本样式

  • 支持 flexbox 相关样式
  • 支持 box 模型相关样式
  • 支持 position 相关属性
  • 支持 opacity,background-color 等。

事件

基本事件:查阅基本事件

例子

<div>
  <image src="..." ></image>
  <text>...</text>
</div>

简写:

<div>
  <img src="..." ></img>
  <text>...</text>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions