zia-snippets
several dependencies
Snippets
snippet |
description |
rfc |
react functional component |
zdp |
zia detail page |
zifi |
zia input form item |
zsfi |
zia select form item |
zrfi |
zia radio form item |
zfr |
zia form rules require |
Full Expansions
rfc - React Functional component
import React from "react";
interface |Props {
|
}
const |: React.FC<|Props> = ({|}:|Props) => {
return | ;
}
export default |;
zdp - Zia Detail Page
import React, { useEffect, useState } from "react";
import { useHistory } from "react-router-dom";
import { ajax, PageTitle } from "|";
import { GlobalState } from "@app/types/index";
interface IProps {
recordId: string;
[x: string]: any;
global?: GlobalState;
}
const PageView: React.FC<IProps> = ({ recordId, global }: IProps) => {
const history = useHistory();
return (
<div>
<PageTitle
isSubPage
showBorder
title=|
onClickBack={() => {
history.push("|");
}}
/>
</div>
);
};
export default PageView;
zifi - Zia Input Form Item
<Form.Item
label="|"
name="|"
rules={[{ required: true, message: "Please enter !" }]}>
<Input placeholder="Please enter " />
</Form.Item>
zsfi - Zia Select Form Item
<Form.Item label="|" name="|">
<Select showSearch allowClear placeholder="Select |">
{|.map((o) => (
<Select.Option key={o.|} value={o.|}>
{o.|}
</Select.Option>
))}
</Select>
</Form.Item>
zrfi - Zia Radio Form Item
<Form.Item label="|" name="|">
<Radio.Group>
{|.map((o) => (
<Radio value={o.|} key={o.|}>{o.|}</Radio>
))}
</Radio.Group>
</Form.Item>
zfr - Zia Form rules required
rules={[{ required: true, message: "" }]}