Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Web / Weex / 阿里小程序 / 微信小程序 / 字节跳动小程序
View 是最基础的组件,它支持 Flexbox、touch handling 等功能,并且可以任意嵌套。 不论在什么容器中,View 都直接对应一个容器的原生视图,就像 web 中的 div 一样。 支持任意自定义属性的透传。
$ npm install rax-view --save
属性 | 类型 | 默认值 | 必填 | 描述 | 支持 |
---|---|---|---|---|---|
className | string | - | false | 自定义样式名 | |
style | CSSProperties | - | false | 自定义样式 | |
onClick | function | - | false | 点击 | |
onLongpress | function | - | false | 长按 | |
onAppear | function | - | false | 当前元素可见时触发 | |
onDisappear | function | - | false | 当前元素从可见变为不可见时触发 | |
onTouchStart | function | - | false | 触摸动作开始 | |
onTouchMove | function | - | false | 触摸后移动 | |
onTouchEnd | function | - | false | 触摸动作结束 | |
onTouchCancel | function | - | false | 触摸动作被打断,如来电提醒,弹窗 |
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: '30rpx'
}}
onClick={() => {
alert("container was clicked!");
}}
>
<View
style={{
width: '300rpx',
height: '300rpx',
backgroundColor: "red"
}}
onClick={e => {
e.stopPropagation();
alert("red was clicked");
}}
/>
<View
style={{
width: '300rpx',
height: '300rpx',
backgroundColor: "green",
position: "absolute",
top: '20rpx',
left: '20rpx'
}}
onClick={() => {
alert("green was clicked");
}}
/>
<View
style={{
width: '300rpx',
height: '300rpx',
backgroundColor: "yellow",
position: "absolute",
top: '80rpx',
left: '210rpx'
}}
onClick={e => {}}
/>
</View>
);
};
render(<App />, document.body, { driver: DU });
rax-view 默认样式如下:
.rax-view-v2 {
box-sizing: border-box;
display: flex;
flex-direction: column;
flex-shrink: 0;
align-content: flex-start;
border: 0 solid black;
margin: 0;
padding: 0;
min-width: 0;
}
FAQs
View component for Rax.
The npm package rax-view receives a total of 178 weekly downloads. As such, rax-view popularity was classified as not popular.
We found that rax-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.