{"bugs":{"url":"https://github.com/raxjs/rax-components/issues"},"dist":{"shasum":"ca6f46e6153baa9a51db9ccc0f6ab4be54762037","tarball":"https://registry.npmjs.org/rax-view/-/rax-view-1.2.0-0.tgz","fileCount":42,"integrity":"sha512-XLDN6u9SViOKEOecb9hTFec1DxJgMdLamfAkBvue4ezlVJj5uog44VOaR5vtsVT2kJvueV7OHw+1omCCMR59Ww==","signatures":[{"sig":"MEQCIBulgRXeoIf8KgEIhI08CR7p4NVmwI6R86fYDanMK4BgAiAMnlvJlJ2AiTriAgY4r4Aq4goHI9gwqZ4/BZcIgGnFXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":36734,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfHsYUCRA9TVsSAnZWagAA7lkQAIGlNWGHpbo487edUndn\nD1f5dYgZeDNpoZ20zE+9sXMx8unndfPJoAMICIyTcCSLtBerOtjVYi5XD+ry\nvYLO3ezCuoqFWDIwv1BhCzuw0K7QCfQxy+JKobXJMJJXhEf4z/8APAqfjgNC\nR1Xlq7YQ1fIxsm2ZIh+gWgEIcfauR7zlKGqnsGmdKcGBLbBwwhrhRTJOepOU\nx+DUw4PZrnHqoprbj470tRzJ0VBcJC+2QQ8dTkVH8kaa7pPHW/Er+vo26t4o\npv35Ha7tStcw/46RHl3NmsUhcJDZuQPmP0xSZbAkAfT5Yq2iVX7SLsouxwqf\nHT/KTXt4h+LrxxL1Neg3PWFC+kjCvWwadxNiJPS9m9FuFcEOVLeN3m0cqb5U\nyzOEq4qCZ1VwOKc8mUBWgM+BPGZp6UUCD81gjdNvr+x0ilDy3OsWk2ZxUHDO\nQRyEfbZBn8UUuzu8Jp8dt1hZjIfMn6xRh8dUWVp2pJfT1wfUkTU8LVBu/Liz\n7v27tb39Mbl6+7Mw4I9fOZRNpa3fuCweYIkHaU8eWRfHp/Q7hNpswjXFzGxg\nB+JKw+otSb+fYat/N49969u95hGgR1l6iyBcLvRefx6ovj5Vh00y1v/NmAJW\nCj8axAj3tnWkQpPZM5lENSkhAg7eB4j55glskW1j1vOU5qzgnK/1yz13nwze\nYTkJ\r\n=FlnD\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"rax-view","types":"lib/index.d.ts","readme":"[![npm](https://img.shields.io/npm/v/rax-view.svg)](https://www.npmjs.com/package/rax-view)\n**描述：**\nView 是最基础的组件，它支持 Flexbox、touch handling 等功能，并且可以任意嵌套。\n不论在什么容器中，View 都直接对应一个容器的原生视图，就像 web 中的 div 一样。\n支持任意自定义属性的透传。\n\n## 安装\n\n```bash\n$ npm install rax-view --save\n```\n\n## 属性\n\n注：\n1、**支持**列表中的 <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表 h5 <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表 weex <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />代表阿里小程序 <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\"> 代表微信小程序\n\n|**属性**| **类型** | **默认值** | **必填** | **描述** | **支持** |\n| ----------- | ---------- | ---------- | ------------ | ------------------ | ------------ |\n| className | `string` | - | false | 自定义样式名 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n| style | `CSSProperties` | - | false | 自定义样式 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n| onClick | `function` | - | false | 点击 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n| onLongpress | `function` | - | false | 长按 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n| onAppear | `function` | - | false | 当前元素可见时触发 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| onDisappear | `function` | - | false | 当前元素从可见变为不可见时触发 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" />|\n| onTouchStart | `function` | - | false | 触摸动作开始 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n| onTouchMove | `function` | - | false | 触摸后移动 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n| onTouchEnd | `function` | - | false | 触摸动作结束 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n| onTouchCancel | `function` | - | false | 触摸动作被打断，如来电提醒，弹窗 | <img alt=\"browser\" src=\"https://gw.alicdn.com/tfs/TB1uYFobGSs3KVjSZPiXXcsiVXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"weex\" src=\"https://gw.alicdn.com/tfs/TB1jM0ebMaH3KVjSZFjXXcFWpXa-200-200.svg\" width=\"25px\" height=\"25px\" /><img alt=\"miniApp\" src=\"https://gw.alicdn.com/tfs/TB1bBpmbRCw3KVjSZFuXXcAOpXa-200-200.svg\" width=\"25px\" height=\"25px\" /> <img alt=\"wechatMiniprogram\" src=\"https://img.alicdn.com/tfs/TB1slcYdxv1gK0jSZFFXXb0sXXa-200-200.svg\" width=\"25px\" height=\"25px\">|\n\n```jsx\nimport { createElement, useRef, useEffect, render } from \"rax\";\nimport DU from \"driver-universal\";\nimport View from \"rax-view\";\n\nconst App = () => {\n  const viewRef = useRef(null);\n  useEffect(() => {});\n  return (\n    <View\n      ref={viewRef}\n      style={{\n        padding: '30rpx'\n      }}\n      onClick={() => {\n        alert(\"container was clicked!\");\n      }}\n    >\n      <View\n        style={{\n          width: '300rpx',\n          height: '300rpx',\n          backgroundColor: \"red\"\n        }}\n        onClick={e => {\n          e.stopPropagation();\n          alert(\"red was clicked\");\n        }}\n      />\n      <View\n        style={{\n          width: '300rpx',\n          height: '300rpx',\n          backgroundColor: \"green\",\n          position: \"absolute\",\n          top: '20rpx',\n          left: '20rpx'\n        }}\n        onClick={() => {\n          alert(\"green was clicked\");\n        }}\n      />\n      <View\n        style={{\n          width: '300rpx',\n          height: '300rpx',\n          backgroundColor: \"yellow\",\n          position: \"absolute\",\n          top: '80rpx',\n          left: '210rpx'\n        }}\n        onClick={e => {}}\n      />\n    </View>\n  );\n};\n\nrender(<App />, document.body, { driver: DU });\n```\n","engines":{"npm":">=3.0.0"},"license":"BSD-3-Clause","scripts":{"test":"npm run build","build":"npm run clean && ../../node_modules/.bin/build-scripts build --config ../../build.json","clean":"rm -rf ./lib && rm -rf ./package-lock.json && rm -f ./yarn.lock && rm -rf demo/miniapp/lib","start":"../../node_modules/.bin/build-scripts start --config ../../build.json","prepublishOnly":"npm run build"},"_npmUser":{"name":"rax-publisher","email":"rax-public@alibaba-inc.com"},"homepage":"https://github.com/raxjs/rax-components#readme","keywords":["Rax","rax-component"],"repository":{"url":"git+https://github.com/raxjs/rax-components.git","type":"git"},"_npmVersion":"6.14.4","description":"View component for Rax.","directories":{},"maintainers":[{"name":"amdgigabyte","email":"amdgigabyte@gmail.com"},{"name":"rax-publisher","email":"rax-publisher@zeroling.com"},{"name":"solojiang","email":"feifeishen1996@gmail.com"},{"name":"wintercn","email":"csf178@gmail.com"},{"name":"yuanyan","email":"yuanyan.cao@gmail.com"},{"name":"zeroling","email":"wssgcg1213@qq.com"}],"_nodeVersion":"10.16.0","dependencies":{"classnames":"^2.2.6","universal-env":"^3.0.0"},"miniappConfig":{"main":"lib/miniapp/index","main:wechat":"lib/miniapp-wechat/index"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"rax":"^1.0.0","eslint":"^5.16.0","csstype":"^2.6.4","@types/rax":"^1.0.0","driver-dom":"^1.0.0","typescript":"^3.5.3","@types/jest":"^24.0.12","driver-weex":"^1.0.0","babel-eslint":"^10.0.3","@types/ali-app":"^1.0.0","driver-universal":"^1.0.0","@types/classnames":"^2.2.9","eslint-config-rax":"^0.0.0","rax-test-renderer":"^1.0.0","eslint-plugin-import":"^2.18.2","@typescript-eslint/parser":"^1.7.0","@typescript-eslint/eslint-plugin":"^1.7.0"},"peerDependencies":{"rax":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/rax-view_1.2.0-0_1595852302036_0.06402662792381753","host":"s3://npm-registry-packages"},"_id":"rax-view@1.2.0-0","version":"1.2.0-0"}