rax-view
View component for Rax.
Last updated 5 years ago by recover758126 .
BSD-3-Clause · Original npm · Tarball · package.json
$ npm install rax-view 
SYNC missed versions from official npm registry.

npm 描述: View 是最基础的组件,它支持 Flexbox、touch handling 等功能,并且可以任意嵌套。 不论在什么容器中,View 都直接对应一个容器的原生视图,就像 web 中的 div 一样。 支持任意自定义属性的透传。

安装

$ npm install rax-view --save

属性

注: 1、支持列表中的 browser代表 h5 weex代表 weex miniApp代表小程序

属性 类型 默认值 必填 描述 支持
className string - false 自定义样式名 browser weex miniApp
style CSSProperties - false 自定义样式 browser weex miniApp
onClick function - false 点击 browser weex miniApp
onLongpress function - false 长按 browser weex miniApp
onAppear function - false 当前元素可见时触发 browser weex miniApp
onDisappear function - false 当前元素从可见变为不可见时触发 browser weexminiApp
onTouchStart function - false 触摸动作开始 browser weexminiApp
onTouchMove function - false 触摸后移动 browser weexminiApp
onTouchEnd function - false 触摸动作结束 browser weexminiApp
onTouchCancel function - false 触摸动作被打断,如来电提醒,弹窗 browser weexminiApp
import { createElement, useRef, useEffect, render } from "rax";
import DU from "driver-universal";
import View from "rax-view";

const App = () => {
  const viewRef = useRef(null);
  useEffect(() => {});
  return (
    <View
      ref={viewRef}
      style={{
        padding: 30
      }}
      onClick={() => {
        alert("container was clicked!");
      }}
    >
      <View
        style={{
          width: 300,
          height: 300,
          backgroundColor: "red"
        }}
        onClick={e => {
          e.stopPropagation();
          alert("red was clicked");
        }}
      />
      <View
        style={{
          width: 300,
          height: 300,
          backgroundColor: "green",
          position: "absolute",
          top: 20,
          left: 20
        }}
        onClick={() => {
          alert("green was clicked");
        }}
      />
      <View
        style={{
          width: 300,
          height: 300,
          backgroundColor: "yellow",
          position: "absolute",
          top: 80,
          left: 210
        }}
        onClick={e => {}}
      />
    </View>
  );
};

render(<App />, document.body, { driver: DU });

Current Tags

  • 2.2.1-beta.1                                ...           beta (3 years ago)
  • 2.3.0                                ...           latest (3 years ago)

111 Versions

  • 2.3.0                                ...           3 years ago
  • 2.2.1                                ...           3 years ago
  • 2.2.1-beta.1                                ...           3 years ago
  • 2.1.0-beta.1                                ...           3 years ago
  • 2.2.0                                ...           3 years ago
  • 2.2.0-0                                ...           3 years ago
  • 2.1.1                                ...           3 years ago
  • 2.1.1-0                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.6-4                                ...           3 years ago
  • 2.0.6-3                                ...           4 years ago
  • 2.0.6-2                                ...           4 years ago
  • 2.0.6-1                                ...           4 years ago
  • 2.0.6-0                                ...           4 years ago
  • 2.0.5                                ...           4 years ago
  • 2.0.5-0                                ...           4 years ago
  • 2.0.4                                ...           4 years ago
  • 2.0.3                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 2.0.0-0                                ...           4 years ago
  • 2.0.0                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.2.0-1                                ...           4 years ago
  • 1.2.0-0                                ...           4 years ago
  • 1.1.2                                ...           5 years ago
  • 1.1.2-beta.1                                ...           5 years ago
  • 1.1.1-1                                ...           5 years ago
  • 1.1.1-0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.1.0-0                                ...           5 years ago
  • 1.0.3-beta.3 [deprecated]           ...           5 years ago
  • 1.0.4-beta.1 [deprecated]           ...           5 years ago
  • 1.0.3-beta.2 [deprecated]           ...           5 years ago
  • 1.0.3-beta.1 [deprecated]           ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.1-beta.11                                ...           5 years ago
  • 1.0.1-beta.10                                ...           5 years ago
  • 1.0.1-beta.9                                ...           5 years ago
  • 1.0.1-beta.8                                ...           5 years ago
  • 1.0.1-beta.7                                ...           5 years ago
  • 1.0.1-beta.6                                ...           5 years ago
  • 1.0.1-beta.5                                ...           5 years ago
  • 1.0.1-beta.4                                ...           5 years ago
  • 1.0.1-beta.3                                ...           5 years ago
  • 1.0.0-miniapp.beta.5                                ...           5 years ago
  • 1.0.1-beta.2                                ...           5 years ago
  • 1.0.1-beta.1                                ...           5 years ago
  • 1.0.1-beta.0                                ...           5 years ago
  • 1.0.0-miniapp.beta.4                                ...           5 years ago
  • 1.0.0-miniapp.beta.3                                ...           5 years ago
  • 1.0.0-miniapp.beta.2                                ...           5 years ago
  • 1.0.0-miniapp.beta.1                                ...           6 years ago
  • 1.0.0-miniapp.beta.0                                ...           6 years ago
  • 1.0.0-beta.2                                ...           6 years ago
  • 1.0.0-beta.1                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 1.0.0-beta.0                                ...           6 years ago
  • 0.6.5                                ...           6 years ago
  • 0.6.4                                ...           6 years ago
  • 0.6.3                                ...           7 years ago
  • 0.6.2                                ...           7 years ago
  • 0.6.1                                ...           7 years ago
  • 0.6.0                                ...           7 years ago
  • 0.5.4                                ...           7 years ago
  • 0.5.2                                ...           7 years ago
  • 0.5.1                                ...           7 years ago
  • 0.5.0                                ...           7 years ago
  • 0.4.20                                ...           7 years ago
  • 0.4.19                                ...           7 years ago
  • 0.4.18                                ...           7 years ago
  • 0.4.17                                ...           7 years ago
  • 0.4.16                                ...           7 years ago
  • 0.4.15                                ...           7 years ago
  • 0.5.0-beta                                ...           7 years ago
  • 0.4.14                                ...           7 years ago
  • 0.4.13                                ...           7 years ago
  • 0.4.12                                ...           7 years ago
  • 0.4.11                                ...           7 years ago
  • 0.4.10                                ...           7 years ago
  • 0.4.9                                ...           7 years ago
  • 0.4.8                                ...           7 years ago
  • 0.4.7                                ...           7 years ago
  • 0.4.6                                ...           7 years ago
  • 0.4.5                                ...           7 years ago
  • 0.4.4                                ...           7 years ago
  • 0.4.3                                ...           7 years ago
  • 0.4.2                                ...           7 years ago
  • 0.4.1                                ...           7 years ago
  • 0.4.0                                ...           7 years ago
  • 0.3.8                                ...           7 years ago
  • 0.3.7                                ...           7 years ago
  • 0.3.6                                ...           7 years ago
  • 0.3.5                                ...           7 years ago
  • 0.3.4                                ...           7 years ago
  • 0.3.3                                ...           8 years ago
  • 0.3.2                                ...           8 years ago
  • 0.3.1                                ...           8 years ago
  • 0.3.0                                ...           8 years ago
  • 0.2.11                                ...           8 years ago
  • 0.2.10                                ...           8 years ago
  • 0.2.9                                ...           8 years ago
  • 0.2.8                                ...           8 years ago
  • 0.2.7                                ...           8 years ago
  • 0.2.6                                ...           8 years ago
  • 0.2.5                                ...           8 years ago
  • 0.2.4                                ...           8 years ago
  • 0.2.3                                ...           8 years ago
  • 0.2.2                                ...           8 years ago
  • 0.2.1                                ...           8 years ago
  • 0.2.0                                ...           8 years ago
Downloads
Total 1
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (19)

© 2010 - cnpmjs.org x YWFE | Home | YWFE