diff --git a/CHANGELOG.md b/CHANGELOG.md index efc64b52b..9760a5c56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # 更新日志 +## 1.5.0 + +- 新增:`` 组件支持控制下拉菜单展示的属性 [#262](https://github.com/XiaoMi/hiui/issues/262) +- 新增:` - - - ) } ``` + ::: ### Status Button @@ -52,24 +49,15 @@ render() { const Col = Grid.Col return (
- - - -
- - - - - - -
- - -
+ + + +
) } ``` + ::: ### Button Size @@ -78,27 +66,19 @@ render() { ```js render() { - const Row = Grid.Row - const Col = Grid.Col return (
- - - - - - - - - - - - - + + + + + +
) } ``` + ::: ### Link Button @@ -111,73 +91,108 @@ render() { const Col = Grid.Col return (
- - - - -
) } ``` + ::: ### Button Group -:::demo +:::demo ```js render() { - const Row = Grid.Row - const Col = Grid.Col return ( -
- - + + + + + + ) +} +``` + +::: - - - - - +### Loading Button - - +:::demo + +```js +constructor() { + super() + Object.assign(this, { + state: { + showLoading: false + }, + handleButtonClick() { + this.setState({ + showLoading: true + }, () => { + setTimeout(() => { + this.setState({ + showLoading: false + }) + }, 3000) + }) + } + }) + this.handleButtonClick = this.handleButtonClick.bind(this) +} +render() { + return ( +
+ + + + +

+ + + +

) } ``` + ::: ### Attributes -| Attribute | Description | Type | Options | Default | -| -------- | ----- | ---- | ---- | ---- | -| type | button type | string | primary,line, success,danger, default | default | -| appearance | display type | string | button, link | button | -| size | button size | string | large, normal, small | normal | -| className | custom class | string | - | - | - +| Attribute | Description | Type | Options | Default | +| ---------- | ------------- | ------- | ---------------------------------------------- | ------- | +| type | button type | string | primary \| line \| success \|danger \| default | default | +| href | target link | string | - | - | +| appearance | display type | string | button \| link | button | +| size | button size | string | large\| normal \| small | normal | +| icon | icon button | string | see [``](/#/en-US/docs/icon) component | - | +| className | custom class | string | - | - | +| style | custom styles | object | - | - | +| loading | show loading | boolean | true \| false | false | ### Events -| Event Name | Description | Parameters -| -------- | ----- | ---- -| onClick | triggers when the Button clicked | - + +| Event Name | Description | Parameters | +| ---------- | -------------------------------- | ---------- | +| onClick | triggers when the Button clicked | Event | diff --git a/docs/en-US/components/card.md b/docs/en-US/components/card.md new file mode 100644 index 000000000..e0ce5f2f8 --- /dev/null +++ b/docs/en-US/components/card.md @@ -0,0 +1,407 @@ + + +## Card 卡片 + + +### 基础 + +:::demo + +Card 组件 + +```js +render() { + const Row = Grid.Row + const Col = Grid.Col + return ( +
+ + 普通 Card + +
+ +

无标题

+

鼠标移入悬浮效果

+

其它额外内容

+
+
+ +

禁用状态

+
+
+ + 无标题,禁用状态 + +
+ ) +} +``` +::: + + +### 不同大小 + +:::demo + +Card 组件 + +```js +render() { + return ( + + +

自定义宽度:200px

+

其它额外内容

+
+
+ +

size = small

+

无标题

+

其它额外内容

+
+
+ +

size = middle

+

无标题

+

其它额外内容

+
+
+ +

size = large

+

无标题

+

其它额外内容

+
+
+ ) +} +``` +::: + +### 额外按钮 + +:::demo + +Card 组件 + +```js +render() { + return ( + + , ]} + extraShow='stay' + title='这里是标题这里是标题这里是标题' + > +

包含额外扩展按钮

+

扩展按钮常驻

+
+
+ , ]} + extraShow='hover' + > +

有扩展按钮,无标题

+

扩展按钮移入后显示

+

其它剩余内容;其它剩余内容;其它剩余内容;其它剩余内容;其它剩余内容;

+
+
+ ) +} +``` +::: + + +### 图片卡片 + +:::demo + +Card 组件 + +```js +render() { + return ( + + } + title='图片展示' + description='图片信息描述:size=small;width:276px' + size='small' + > +
+ } + title='图片展示' + description='图片信息描述:size=middle;width:376px' + size='middle' + > + +
+ } + title='图片展示' + description='图片信息描述:size=large;width:576px' + size='large' + > +
+ ) +} +``` +::: + + +### 简易卡片 + +:::demo + +Card 组件 + +```js +render() { + return ( + + + 简易卡片 + +
+ + 简易卡片 + +
+ + 简易卡片 + +
+ + 简易卡片 + +
+ ) +} +``` +::: + +### 配合 Gird 布局 - 图片排版 + +:::demo + +配合 Grid 布局实现更加简单 + +```js +render() { + const {Row, Col} = Grid + return ( + + + + } + title='图片展示' + description='这是图片描述' + > + + + } + title='图片展示' + description='这是图片描述' + > + + + } + title='图片展示' + description='这是图片描述' + > + + + } + title='图片展示' + description='这是图片描述' + > + + + + + } + title='图片展示' + description='这是图片描述' + > + + + } + title='图片展示' + description='这是图片描述' + > + + + } + title='图片展示' + description='这是图片描述' + > + + + } + title='图片展示' + description='这是图片描述' + > + + + + ) +} +``` +::: + +### 配合 Gird 布局 - 展示 + +:::demo + +配合 Grid 布局实现更加简单 + +```js +render() { + const {Row, Col} = Grid + return ( + + + + + 简易卡片 + + + + + 简易卡片 + + + + + 简易卡片 + + + + + 简易卡片 + + + + + 简易卡片 + + + + + 简易卡片 + + + + + ) +} +``` +::: + + +### 配合 Gird 布局 - 自定义展示 + +:::demo + +配合 Grid 布局实现更加简单 + +```js +render() { + const {Row, Col} = Grid + const colors = ['#46bc99', '#37d5fa', '#b450de', '#fadb14'] + const cols = colors.map((color, index) => { + return ( + + +

无标题

+

鼠标移入悬浮效果

+

其它额外内容

+
+ + ) + }) + return ( + + + {cols} + + + ) +} +``` +::: + + +### Card Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ------- | ------- | ------- | ------- | ------- | +| title | 卡片标题 | String \| Element | - | - | +| size | 卡片大小
small -> 276px
middle -> 376px
large -> 576px
不传入 size 将占100%宽度| String | small \| middle \| large | 100% | +| type | 卡片类型 | String | simple | - | +| style | 自定义样式 | Object | - | - | +| hoverable | 鼠标移入卡片是否显示浮起效果 | Boolean | true \| false | false | +| extra | 卡片右上的扩展按钮 | Array[Elemnt] \| Element | - | - | +| extraShow | 扩展按钮的显示模式 | String | stay \| hover | stay | +| cover | 图片卡片 | ImgElement | - | - | +| description | 图片卡片的信息描述 | String \| Element | - | - | +| disabled | 是否禁用卡片 | Boolean | true \| false | - | diff --git a/docs/en-US/components/form.md b/docs/en-US/components/form.md index 17c3f8974..3a65595ea 100644 --- a/docs/en-US/components/form.md +++ b/docs/en-US/components/form.md @@ -1,12 +1,8 @@ ## Form - - ### Align -:::demo - - +:::demo ```js @@ -64,13 +60,12 @@ render(){ ) } ``` + ::: ### Inline -:::demo - - +:::demo ```js @@ -90,13 +85,12 @@ render(){ ) } ``` + ::: ### Form Validation -:::demo - - +:::demo ```js @@ -107,9 +101,9 @@ constructor(props) { form: { name: '', region: '', - count: '' + count: '', + type: [] }, - checkedIndex: -1, rules: { name: [ { @@ -120,15 +114,17 @@ constructor(props) { ], region: [ { + required: true, message: 'select area', - trigger: 'change' + type: 'number', + trigger: 'onChange' } ], count: [ { required: true, message: 'input count', - trigger: 'change' + trigger: 'onChange' }, { validator: (rule, value, cb) => { @@ -149,7 +145,6 @@ constructor(props) { } handleSubmit() { - this.form.current.validate(valid => { if(valid) { console.log(this.state.form) @@ -166,9 +161,7 @@ handleChange(key, e, value, index) { this.setState({ form: Object.assign({}, this.state.form, {[key]: value}) }) - if(index !== undefined) { - this.setState({ checkedIndex: index }) @@ -177,7 +170,6 @@ handleChange(key, e, value, index) { render(){ const {form, checkedIndex} = this.state - return (
@@ -208,27 +200,32 @@ render(){ ) } ``` -::: +::: ### Form Attributes -| Attribute | Description | Type | Options | Default | -| --- | --- | --- | ---- | --- | -| model | Form data | object | - | - | -| rules | Form validation rule | object | - | - | -| labelWidth | label width | string | | -| labelPosition | label position | bool |right/left/top|right| -| inline | Whether it is arranged horizontally | bool | - | false| - +| Attribute | Description | Type | Options | Default | +| ------------- | ----------------------------------- | ------- | -------------- | ------- | +| model | Form data | object | - | - | +| rules | Form validation rule | object | - | - | +| labelWidth | label width | string | - | - | +| labelPosition | label position | boolean | right/left/top | right | +| inline | Whether it is arranged horizontally | boolean | - | false | ### FormItem Attributes -| Attribute | Description | Type | Options | Default | -| --- | --- | --- | ---- | --- | -| prop | model field | string | - | - | -| label | label text | string | - | - | -| labelWidth | label width | string | | -| required | required | bool | - | false | +| Attribute | Description | Type | Options | Default | +| ---------- | ----------- | ------ | ------- | ------- | +| prop | model field | string | - | - | +| label | label text | string | - | - | +| labelWidth | label width | string | - | - | +| required | required | bool | - | false | +### Form Methods +| Event Name | Description | Paramerters | +| ----------------------------- | ----------------------- | ---------------------------------------- | +| validate(callback) | validate the whole form | (valid: boolean) => void | +| validateField(prop, callback) | valiate single field | (prop: string, (valid: boolean) => void) | +| resetValidates | reset validate | - | diff --git a/docs/en-US/components/loading.md b/docs/en-US/components/loading.md index 88b056ccc..25f3dce22 100644 --- a/docs/en-US/components/loading.md +++ b/docs/en-US/components/loading.md @@ -94,8 +94,9 @@ render () { columns={this.columns} data={this.state.list} /> -
- +
+ +
@@ -136,4 +137,4 @@ render () { | size | Size | string | large default small | default | | tip | Text | string | - | | | full | Whether full screen | bool | - | false | -| show | Whether to display the loading animation | boolean | true false | false | \ No newline at end of file +| show | Whether to display the loading animation | boolean | true false | false | diff --git a/docs/en-US/components/rate.md b/docs/en-US/components/rate.md new file mode 100644 index 000000000..b4e31cadd --- /dev/null +++ b/docs/en-US/components/rate.md @@ -0,0 +1,117 @@ +## Rate + +The rate component. + +### Basic + +:::demo + +```js +render() { + return ( + + + + + + + + + ) +} +``` + +::: + +### Advanced + +:::demo + +```js +constructor() { + super() + this.state = { + value: 3 + } + this.tooltips = ['terrible', 'bad', 'normal', 'good', 'wonderful'] +} + +render() { + const { value } = this.state + return ( +
+ + + + + { + this.setState({value}) + }} value={value} /> + + + + + + + +
+ ) +} +``` + +::: + +### Use emoji + +:::demo + +```js +constructor() { + super() + this.tooltips = ['terrible', 'bad', 'normal', 'good', 'wonderful'] +} + +render() { + return ( +
+ +
+ + + + + + + + + + + + + + ) +} +``` + +::: + +### Rate Attributes + +| Property | Description | Type | Options | Default | +| ------------ | --------------------------------------- | -------- | ------- | ------- | +| allowClear | whether to allow clear when click again | boolean | - | true | +| allowHalf | whether to allow semi selection | boolean | - | true | +| useEmoji | whether to use emoji | boolean | - | false | +| className | custom class name of rate | string | - | - | +| count | star count, not work whem use emoji | number | - | 5 | +| defaultValue | default value | number | - | 0 | +| disabled | read only, unable to interact | boolean | - | false | +| style | custom style object of rate | object | - | - | +| tooltips | custom tooltip by each character | string[] | - | - | +| value | current value | number | - | - | + +### Rate Events + +| Attribute | Description | Parameters | +| --------- | -------------- | --------------- | +| onChange | click callback | (value: number) | diff --git a/docs/en-US/components/select.md b/docs/en-US/components/select.md index 2d791ecbf..c6040043f 100644 --- a/docs/en-US/components/select.md +++ b/docs/en-US/components/select.md @@ -34,8 +34,8 @@ render () { placeholder='Please Select' style={{width: '200px'}} value={'3'} - onChange={(item) => { - console.log('Result', item) + onChange={(item, changedItem) => { + console.log('Result', item, changedItem) }} /> @@ -78,8 +78,8 @@ render () { placeholder='Please Select' style={{width: '200px'}} value={'3'} - onChange={(item) => { - console.log('Result', item) + onChange={(item, changedItem) => { + console.log('Result', item, changedItem) }} disabled /> @@ -119,8 +119,8 @@ render () { placeholder='Please Select...' style={{width: '200px'}} value={'3'} - onChange={(item) => { - console.log('Result', item) + onChange={(item, changedItem) => { + console.log('Result', item, changedItem) }} /> @@ -152,8 +152,8 @@ render () { }} placeholder='Please Select...' style={{width: '200px'}} - onChange={(item) => { - console.log('Result', item) + onChange={(item, changedItem) => { + console.log('Result', item, changedItem) }} /> @@ -192,8 +192,8 @@ render () { list={this.state.multipleList} value='4,5' placeholder='Please Select...' - onChange={(item) => { - console.log('Result', item) + onChange={(item, changedItem) => { + console.log('Result', item, changedItem) }} /> @@ -213,7 +213,7 @@ Asynchronous multiple selection render () { return (
- console.log('error:', err) }} - onChange={(item) => { - console.log('异步多选结果', item) + onChange={(item,changedItem) => { + console.log('异步多选结果', item, changedItem) }} />
@@ -319,6 +319,7 @@ render () { | origin | 异步选择配置,详见下表 | Object | - | - | | value | 默认值被选中项,值与被选中的id相同,多个以,分割或者传递数组| String \| Number \| Array | - | - | | showCheckAll | 是否显示全选,只对多选生效 | Boolean | true \| false | false | +| open (1.5新增) | 是否显示下拉菜单 | Boolean | true \| false | true | | searchable | 是否可以筛选 | Boolean | true \| false | false | | clearable | 是否可以清空 | Boolean | true \| false | true | | autoload | origin从远端获取数据,初始时是否自动加载 | Boolean | true \| false | false | @@ -355,4 +356,4 @@ render () { | 参数 | 说明 | 回调参数 | | -------- | ----- | ---- | -| onChange | 改变选项时触发函数 | (item: Object\|Array) | +| onChange | 改变选项时触发函数 | (item: Object\|Array, changedItem:Object\|Array) | diff --git a/docs/zh-CN/components/switch.md b/docs/zh-CN/components/switch.md new file mode 100755 index 000000000..09413ef18 --- /dev/null +++ b/docs/zh-CN/components/switch.md @@ -0,0 +1,57 @@ +## Switch + + +### 基础用法 + +:::demo + +基础用法 + +```js +constructor (props) { + super(props) + this.state = { + checked: true, + disabled: true + } +} +onChange (status) { + console.log(status) +} +render () { + return ( +
+

默认

+ +

自定义内容

+ + , ]}/> +

禁用状态

+

+ + +

+ +
+ ) +} +``` +::: + + + +### Switch Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| -------- | ----- | ---- | ---- | ---- | +| content | 自定义显示内容 | Array[String \| Element] | - | '' | +| checked | 是否默认开启状态 | Boolean | true \| false | false | +| disabled | 是否默认禁用状态 | Boolean | true \| false | false | +| size | 弹框大小类型 | String | small \| middle \| large | middle | + + +### Switch Events + +| 参数 | 说明 | 回调参数 | +| ------- | ------- | ------- | +| onChange | 切换的回调函数 | 当前状态 | diff --git a/docs/zh-CN/components/table.md b/docs/zh-CN/components/table.md index 0d2fabb8c..361bbc7cf 100644 --- a/docs/zh-CN/components/table.md +++ b/docs/zh-CN/components/table.md @@ -938,8 +938,8 @@ render() { onChange:(page,pre,size)=>{ this.set(page) }, - position : 'right' // 分页位置 - 默认右侧 - + position : 'center', + }} /> } @@ -952,7 +952,8 @@ render() { constructor (props) { super(props) this.state = { - from: '' + from: '', + pageSize:'' } window.selectTable = this @@ -960,7 +961,8 @@ constructor (props) { render () { const { - from + from, + pageSize } = this.state const rowSelection = { @@ -1003,7 +1005,7 @@ constructor (props) { from, startTime: '', endTime: '', - pageSize:2 + pageSize }, method: "POST", auto:true, // 自动发请求配置(默认false) @@ -1016,6 +1018,22 @@ constructor (props) { serverSort:[{sort:'desc', sort:'adesc'}] //点击排序的箭头图标会将数组中某一项放到请求参数里 }) + const pageSizeOptions = [{ + value: 10, + title: '10' + }, { + value: 20, + title: '20' + }, { + value: 50, + title: '50' + }, { + value: 100, + title: '100' + }] + + + return { data, columns, @@ -1023,7 +1041,16 @@ constructor (props) { pageSize, total: totalNum, current: pageNum, - position: 'middle' + position: 'middle', + showTotal: true, + + pageSizeOptions, + sizeChangeEvent:(pageSize,current) => { + this.setState({ + pageSize + }) + } + } } }, @@ -1071,12 +1098,12 @@ constructor (props) { | 参数 | 说明 | 类型 | 可选值 | 默认值 | | -------- | ----- | ---- | ---- | ---- | -| size | 表格尺寸 | String | large \| small \| normal | normal | -| bordered | 是否显示边框 | Boolean | true \| false | false | -| striped | 斑马纹 | Boolean | true \| false | false | -| columns | 表格数据列对应信息 | Array | - | - | -| data | 表格数据 | Array | - | - | -| emptyText | 数据为空时展示的文案 | String | - | No Data | +| size | 表格尺寸 | String | large,small,normal | normal | +| bordered | 是否显示边框 | Bollean | - | false | +| striped | 斑马纹 | Bollean | - | false | +| columns | 表格数据列对应信息 | array | - | - | +| data | 表格数据 | array | - | - | +| emptyText | 数据为空时展示的文案 | string | - | No Data | | scroll | 设置横向滚动,也可用于指定滚动区域的宽,建议为`x`设置一个数字,如果不设置,默认table宽度为100% | number | true | - | | fixTop | 吸顶 | Number | true | false | | pagination | 查看分页组件配置 | Object | - | false | diff --git a/docs/zh-CN/components/time-picker.md b/docs/zh-CN/components/time-picker.md index 9d3d9a2d7..457f8eb8f 100644 --- a/docs/zh-CN/components/time-picker.md +++ b/docs/zh-CN/components/time-picker.md @@ -11,9 +11,20 @@ render() {

时间选择

console.log('时间', date)} />
+
+

时间范围选择

+ console.log('时间范围', date)} + /> +
) } @@ -25,4 +36,4 @@ render() { | 参数 | 说明 | 回调参数 | 说明 | | -------- | ----- | ---- | ---- | -| onChange | 选中回调函数 | (date: Date) | - | \ No newline at end of file +| onChange | 选中回调函数 | (date: Date) | - | diff --git a/docs/zh-CN/components/timeline.md b/docs/zh-CN/components/timeline.md new file mode 100755 index 000000000..3a8a4aa66 --- /dev/null +++ b/docs/zh-CN/components/timeline.md @@ -0,0 +1,238 @@ +## 时间轴 Timeline + +### 基础用法 + +:::demo + +基础用法 + +```js +render () { + const datas = [{ + groupTitle: '2月', + children: [{ + title: 'Title - 1', + description: 'Here are some descriptions', + timestamp: '10:00', + extraTime: '02-23' + }, { + dot: 'circle', + title: 'Title 2', + description: 'Here are some descriptions', + timestamp: '10:00', + extraTime: '02-27' + }] + }, { + groupTitle: '3月', + children: [{ + dot: 'circle', + title: 'Title 3', + description: 'Here are some descriptions', + timestamp: '12:00', + extraTime: '03-02' + }, { + dot: 'circle', + title: 'Title 4', + description: 'Here are some descriptions', + timestamp: '11:00', + extraTime: '03-10' + }] + }] + return ( +
+
+ +
+
+ ) +} +``` + +::: + +### 信息流 + +:::demo + +基础用法 + +```js +render () { + const datas = [{ + title: 'Title - 1', + description: 'Here are some descriptions', + timestamp: '2019.02.24 12:00:00' + }, { + dot: 'circle', + title: 'Title 2', + description: 'Here are some descriptions', + timestamp: '2019.02.24 14:24:00' + },{ + dot: 'circle', + title: 'Title 3', + description: 'Here are some descriptions', + timestamp: '2019.02.24 15:00:00' + }, { + dot: 'circle', + title: 'Title 4', + description: 'Here are some descriptions', + timestamp: '2019.02.24 19:55:00' + }] + return ( +
+
+ +
+
+ ) +} +``` + +::: + +### 可折叠 + +:::demo + +可折叠 + +```js +render () { + const datas = [{ + title: 'Title - 1', + description: 'Here are some descriptions', + timestamp: '2019.02.24 12:00:00' + }, { + dot: 'circle', + title: 'Title 2', + description: 'Here are some descriptions', + timestamp: '2019.02.24 14:24:00' + },{ + dot: 'circle', + title: 'Title 3', + description: 'Here are some descriptions', + timestamp: '2019.02.24 15:00:00', + folding: true, + children: [{ + title: 'Sub 1', + description: 'Here are some descriptions' + }, { + title: 'Sub 2', + description: 'Here are some descriptions' + }] + }, { + dot: , + title: 'Title 2-2', + description: 'Here are some descriptions', + timestamp: '12:00' + }, { + dot: 'circle', + title: 'Title 4', + description: 'Here are some descriptions', + timestamp: '2019.02.24 19:55:00' + }] + return ( +
+
+ +
+
+ ) +} +``` + +::: + +### 左右结构 + +:::demo + +左右结构 + +```js +render () { + const datas = [{ + groupTitle: '上午', + children: [{ + // dot: , + title: 'Title - 1', + description: 'Here are some descriptions', + timestamp: '9:00', + extraTime: '02-25' + }, { + dot: 'circle', + title: 'Title 1-2', + description: 'Here are some descriptions', + timestamp: '10:00' + }] + }, { + groupTitle: '下午', + children: [{ + dot: 'circle', + title: 'Title 2-1', + description: 'Here are some descriptions', + timestamp: '12:00', + folding: true, + children: [{ + title: 'Sub 1', + description: 'Here are some descriptions' + }, { + title: 'Sub 2', + description: 'Here are some descriptions' + }] + }, { + dot: , + title: 'Title 2-2', + description: 'Here are some descriptions', + timestamp: '12:00' + }] + }, { + groupTitle: 'Group 3', + children: [{ + dot: 'circle', + title: 'Title 3-1', + description: 'Here are some descriptions', + timestamp: '11:00', + extraTime: '11-25' + }, { + dot: 'circle', + title: 'Title 3-2', + description: 'Here are some descriptions', + timestamp: '12:00' + }] + }] + return ( +
+ +
+ ) +} +``` + +::: + +### Timeline Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ------ | -------- | ------ | --------------------------------------------------------- | ------ | +| layout | 布局形式 | String | normal:基础布局
right:靠右布局
cross:交替布局 | normal | +| list | 数据 | Array | - | - | + +### List Options + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ----------- | -------------- | ----------------- | ------ | ------ | +| title | 标题 | String \| Element | - | - | +| description | 描述信息 | String \| Element | - | - | +| timestamp | 时间点 | String | - | - | +| extraTime | 额外展示时间点 | String | - | - | +| dot | 自定义图标 | Element | - | - | + +> 使用分组时间轴,需要结合 groutTitle\* + +```json +{ + groupTitle: '分组标题', + children: [{List Options}] +} +``` diff --git a/docs/zh-CN/components/tooltip.md b/docs/zh-CN/components/tooltip.md index 04a0f7fe5..ebd4daee1 100644 --- a/docs/zh-CN/components/tooltip.md +++ b/docs/zh-CN/components/tooltip.md @@ -4,7 +4,7 @@ ### 基础 -:::demo +:::demo Tooltip 组件 @@ -12,19 +12,78 @@ Tooltip 组件 render() { return (
- - - - + + + + + + + + + + + +
) } ``` + +::: + +### API + +#### `Tooltip.open({ target, title, placement })` + +:::demo + +```js +constructor() { + super() + Object.assign(this, { + state: { + showTooltip: false, + }, + closure: undefined, + toggleTooltip: () => { + !this.state.showTooltip ? + this.closure = Tooltip.open({ target: this.node, title: 'Click again to hide me.', placement: 'right' }) : + this.closure.close() + this.setState(({ showTooltip }) => ({ + showTooltip: !showTooltip + })) + } + }) +} + +render() { + return ( +
+ +

+ this.node = node}> + + +

+ ) +} +``` + ::: ### Tooltip Attributes -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -| ------- | ------- | ------- | ------- | ------- | -| title | 提示文字内容 | String | 字符串 | -- | -| placement | tooltip显示的位置 | String | top \| right \| bottom \| left | top | +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| --------- | ------------------ | ------ | ------------------------------ | ------ | +| title | 提示文字内容 | String | 字符串 | -- | +| placement | tooltip 显示的位置 | String | top \| right \| bottom \| left | top | + +### Tooltip API + +#### `Tooltip.open({ target, title, placement })` + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| --------- | --------------------- | ----------- | ------------------------------ | ------ | +| target | 要显示 tooptip 的元素 | HTMLElement | - | - | +| title | 提示文字内容 | String | - | - | +| placement | tooltip 显示的位置 | String | top \| right \| bottom \| left | top | diff --git a/docs/zh-CN/components/transfer.md b/docs/zh-CN/components/transfer.md new file mode 100755 index 000000000..9c50a3af6 --- /dev/null +++ b/docs/zh-CN/components/transfer.md @@ -0,0 +1,303 @@ +## Transfer + +### 基础用法 + +:::demo + +基础用法 + +```js +constructor () { + super() + this.state = { + datas: this.randomDatas(), + targetKeys: [2, 3] + } +} +randomDatas () { + const arr = [] + for (let i=1;i<16; i++) { + arr.push({ + id: i, + content: '选项'+i, + disabled: i%3 === 0 + }) + } + return arr +} +onChange (movedKeys) { + this.setState({ + targetKeys: movedKeys + }) +} +render () { + return ( + + ) +} +``` +::: + + +### 批量 + +:::demo + +批量 + +```js +constructor () { + super() + this.state = { + datas: this.randomDatas(), + targetKeys: [], + disabled: false + } +} +randomDatas () { + const arr = [] + for (let i=1;i<16; i++) { + arr.push({ + id: i, + content: '选项'+i, + disabled: i%3 === 0 + }) + } + return arr +} +onChange (movedKeys) { + this.setState({ + targetKeys: movedKeys, + disabled: movedKeys.length > 5 + }) +} +render () { + return ( +
+ +
+ ) +} +``` +::: + +### 全选 + +:::demo + +全选 + +```js +constructor () { + super() + this.state = { + datas: this.randomDatas(), + targetKeys: [2, 3] + } +} +randomDatas () { + const arr = [] + for (let i=1;i<16; i++) { + arr.push({ + id: i, + content: '选项'+i + }) + } + return arr +} +onChange (movedKeys) { + this.setState({ + targetKeys: movedKeys + }) +} +render () { + return ( + + ) +} +``` +::: + + +### 搜索 + +:::demo + +搜索 + +```js +constructor () { + super() + this.state = { + datas: this.randomDatas(), + targetKeys: [2, 3] + } +} +randomDatas () { + const arr = [] + for (let i=1;i<16; i++) { + arr.push({ + id: i, + content: '选项'+i + }) + } + return arr +} +onChange (movedKeys) { + this.setState({ + targetKeys: movedKeys + }) +} +render () { + return ( + + ) +} +``` +::: + + +### 目标数量上限 + +:::demo + +目标数量上限 + +```js +constructor () { + super() + this.state = { + datas: this.randomDatas(), + targetKeys: [] + } +} +randomDatas () { + const arr = [] + for (let i=1;i<16; i++) { + arr.push({ + id: i, + content: '选项'+i + }) + } + return arr +} +onChange (movedKeys) { + this.setState({ + targetKeys: movedKeys + }) +} +render () { + return ( + + ) +} +``` +::: + +### 目标区域拖拽 + +:::demo + +目标区域拖拽 + +```js +constructor () { + super() + this.state = { + datas: this.randomDatas(), + targetKeys: [2, 3, 4, 6, 9] + } +} +randomDatas () { + const arr = [] + for (let i=1;i<16; i++) { + arr.push({ + id: i, + content: '选项'+i + }) + } + return arr +} +onChange (movedKeys) { + this.setState({ + targetKeys: movedKeys + }) +} +render () { + return ( + + ) +} +``` +::: + + +### Alert Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| -------- | ----- | ---- | ---- | ---- | +| mode | 类型 | String | basic \| multiple | basic | +| showAllSelect | 是否显示全选按钮 | Boolean | true \| false | false | +| title | 标题
数组长度1或2位,1位时左右标题将相同,2位时将使用对应索引标题 | Array[String \| Element] | - | '' | +| searchable | 是否可筛选 | Boolean | true \| false | false | +| emptyContent | 数据为空时的显示内容
数组长度1或2位,1位时左右内容将相同,2位时将使用对应索引内容| Array[String \| Element] | - | 暂无数据 | +| draggable | 是否允许目标框内拖拽排序 | Boolean | true \| false | false | +| targetKeys | 目标框内的元素id集合 | Array | - | - | +| data | 数据集合 | Array | - | 参见 Data Options | +| targetLimit | 目标框数据上限 | Number | - | null | + + + +### Data Options +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| -------- | ----- | ---- | ---- | ---- | +| id | 唯一 id | Number | - | - | +| content | 元素内容 | String \| Element | - | - | +| disabled | 该元素是否被禁用 | Boolean | true \| false | false | + +### Alert Events + +| 参数 | 说明 | 回调参数 +| ------- | ------- | ------- | +| onChange | 选中元素被移动到目标框内后触发的事件函数 | 目标框内元素的 id 集合,如[2,3,4] | diff --git a/docs/zh-CN/components/tree.md b/docs/zh-CN/components/tree.md index 57d8262a4..6019e941a 100644 --- a/docs/zh-CN/components/tree.md +++ b/docs/zh-CN/components/tree.md @@ -1,8 +1,7 @@ -## Tree控件 +## Tree 控件 树形菜单 - ### 普通用法 普通用法 @@ -15,10 +14,11 @@ constructor(props) { this.state = { treeData: [ { id: 1, title: '小米', + expanded: false, children: [ { id: 2, title: '技术', children: [ - { id: 3, title: '后端', onClick: data => {console.log('后端:', data)} }, + { id: 3, title: '后端', onClick: data => {console.log('后端:', data)} }, { id: 4, title: '运维' }, { id: 5, title: '前端' } ] @@ -28,9 +28,9 @@ constructor(props) { }, { id: 11, title: '小米', children: [ - { id: 22, title: 技术, + { id: 22, title: '技术', children: [ - { id: 33, title: '后端' }, + { id: 33, title: '后端' }, { id: 44, title: '运维' }, { id: 55, title: '前端' } ] @@ -42,21 +42,13 @@ constructor(props) { } } -clickEvent () { - const data = this.state.treeData - data.push({ - id: 2, - title: '其它' - }) - this.setState({ - treeData: data - }) -} + render() { return ( -
+
{console.log('toggle: data isExpanded', data, isExpanded)}} @@ -66,15 +58,79 @@ render() { highlightable onNodeClick={(item) => console.log('------click node', item)} /> -
) } ``` + ::: +### 异步加载 -### checkbox +点击展开异步加载树的子节点 + +:::demo + +```js +constructor(props) { + super(props) + this.state = { + treeData: [ + { id: 1, title: '小米', + children: [ + { id: 2, title: '技术', + children: [ + { id: 3, title: '后端', onClick: data => {console.log('后端:', data)} }, + { id: 4, title: '运维' }, + { id: 5, title: '前端' } + ] + }, + { id: 6, title: '产品' } + ] + }, + { id: 11, title: '小米', + children: [ + { id: 22, title: '技术' + }, + { id: 66, title: '产品' } + ] + }, + ] + } + +} + +render() { + return ( +
+ {return res.data} + }} + defaultExpandAll + editable={true} + data={this.state.treeData} + defaultCheckedKeys={[2]} + onNodeToggle={(data, isExpanded) => {console.log('toggle: data isExpanded', data, isExpanded)}} + onChange={data => {console.log('Tree data:', data)}} + openIcon='down' + closeIcon='up' + highlightable + onNodeClick={(item) => console.log('------click node', item)} + /> +
+ ) +} +``` + +::: + +### 多选 :::demo @@ -84,11 +140,12 @@ checkbox constructor(props) { super(props) this.treeData = [ - { id: 1, title: '小米', + { id: 1, title: '小米人', + expanded: true, children: [ { id: 2, title: '技术', children: [ - { id: 3, title: '后端',disabled:true }, + { id: 3, title: '后端',disabled:true }, { id: 4, title: '运维' }, { id: 5, title: '前端' } ] @@ -100,7 +157,7 @@ constructor(props) { children: [ { id: 22, title: '技术2', expand: true, children: [ - { id: 33, title: '后端2' }, + { id: 33, title: '后端2' }, { id: 44, title: '运维2' }, { id: 55, title: '前端2' } ] @@ -119,6 +176,7 @@ render() {
{console.log('toggle: data isExpanded', data, isExpanded)}} @@ -128,6 +186,9 @@ render() { checkedKeys }) }} + onCheck={(checkedKeys, item, bool, semi) => { + console.log('on check:', checkedKeys, item, bool ,semi) + }} highlightable onClick={data=>{console.log('tree node click',data)}} withLine @@ -136,46 +197,256 @@ render() { ) } ``` + ::: +### 可搜索 -### Tree Attributes +通过搜索框对树进行过滤 -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -| ------- | ------- | ------- | ------- | ------- | -| data | 展示数据 | Array | 参见 Tree Attributes-data | - | -| checkable | 节点前添加 Checkbox 复选框 | Boolean | false | - | -| options | 配置选项 | Object | 参见 Tree Attributes-options | - | -| defaultExpandAll | 是否默认展开所有树节点 | Boolean | - | false | -| checkedKeys | 默认选中的checkbox | Array | - | - | -| openIcon | 表示展开的图标 | String | Icon 图标名称 | - | -| closeIcon | 表示闭合的图标 | String | Icon 图标名称 | - | -| style | 组件整体样式 | Object | - | - | -| highlightable | 高亮 | Boolean -| withLine | 是否显示连接线 | Boolean | - | false | +:::demo -### Tree Attributes-data +```js +constructor(props) { + super(props) + this.state = { + treeData: [ + { id: 1, title: '小米快递', + children: [ + { id: 2, title: '技术', + children: [ + { id: 3, title: '后端', onClick: data => {console.log('后端:', data)} }, + { id: 4, title: '运维' }, + { id: 5, title: '前端' } + ] + }, + { id: 6, title: '产品' } + ] + }, + { id: 11, title: '小米', + children: [ + { id: 22, title: '技术', + children: [ + { id: 33, title: '后端' }, + { id: 44, title: '运维' }, + { id: 55, title: '前端' } + ] + }, + { id: 66, title: '产品' } + ] + }, + ] + } -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -| ------- | ------- | ------- | ------- | ------- | -| expand | 默认是否展开子菜单(优先级高于defaultExpandAll) | Blooean | - | false | -| onClick | 点击每项时触发的事件 | Function | - | - | -| onNodeClick | 点击每项时触发,onClick作用具体绑定的项,onNodeClick作用于所以项 | Function | - | - | -| style | 单个节点样式 | Object | - | - | +} -### Tree Attributes-options +render() { + return ( +
+ {console.log('toggle: data isExpanded', data, isExpanded)}} + onChange={data => {console.log('Tree data:', data)}} + openIcon='down' + closeIcon='up' + highlightable + onNodeClick={(item) => console.log('------click node', item)} + /> +
+ ) +} +``` + +::: + +### 可编辑 + +通过树的节点进行新增、删除、编辑等操作 + +:::demo -| 参数 | 说明 | 类型 | 可选值 | 默认值 | -| ----------| ------- | ------- | ------- | ------- | -| title | 指定节点标签为节点对象的某个属性值 | String | - | title | -| children | 指定子树为节点对象的某个属性值 | String | - | children | +```js +constructor(props) { + super(props) + this.state = { + treeData: [ + { id: 1, title: '小米快递', + children: [ + { id: 2, title: '技术', + children: [ + { id: 3, title: '后端', onClick: data => {console.log('后端:', data)} }, + { id: 4, title: '运维' }, + { id: 5, title: '前端' } + ] + }, + { id: 6, title: '产品' } + ] + }, + { id: 11, title: '小米', + children: [ + { id: 22, title: '技术', + children: [ + { id: 33, title: '后端' }, + { id: 44, title: '运维' }, + { id: 55, title: '前端' } + ] + }, + { id: 66, title: '产品' } + ] + }, + ] + } -### Tree Events +} +render() { + return ( +
+ {console.log('toggle: data isExpanded', data, isExpanded)}} + onSave={(saveNode, data) => { + console.log(saveNode, data) + }} + onDelete={(deleteNode, data) => { + console.log(deleteNode, data) + }} + onChange={data => {console.log('Tree data:', data)}} + openIcon='down' + closeIcon='up' + highlightable + onNodeClick={(item) => console.log('------click node', item)} + /> +
+ ) +} +``` + +::: + +### 可拖拽 -| 参数 | 说明 | 回调参数 | -| -------- | ----- | ---- | -| onChange | 改变复选框状态时触发 | checkedArr, title, isChecked | -| onNodeToggle | 节点被点击(展开/收起)时触发 | (data: Obejct, isExpanded: Boolean) | -| onCheckChange | 节点选中项 | checkedArr, title, isChecked | +对树的节点进行拖拽操作 +:::demo + +```js +constructor(props) { + super(props) + this.state = { + treeData: [ + { id: 1, title: '小米快递', + children: [ + { id: 2, title: '技术', + children: [ + { id: 3, title: '后端', onClick: data => {console.log('后端:', data)} }, + { id: 4, title: '运维' }, + { id: 5, title: '前端' } + ] + }, + { id: 6, title: '产品' } + ] + }, + { id: 11, title: '小米', + children: [ + { id: 22, title: '技术', + children: [ + { id: 33, title: '后端' }, + { id: 44, title: '运维' }, + { id: 55, title: '前端' } + ] + }, + { id: 66, title: '产品' } + ] + }, + ] + } + +} + +render() { + return ( +
+ { + console.log(dragNode) + }} + onDrop = {(dragNode,dropNode)=> { + console.log(dragNode,dropNode) + }} + onNodeToggle={(data, isExpanded) => {console.log('toggle: data isExpanded', data, isExpanded)}} + onChange={data => {console.log('Tree data:', data)}} + openIcon='down' + closeIcon='up' + highlightable + onNodeClick={(item) => console.log('------click node', item)} + /> +
+ ) +} +``` + +::: + +### Tree Attributes + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ---------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------- | ---------------------------- | ------ | +| data | 展示数据 | Array | 参见 Tree Attributes-data | - | +| checkable | 节点前添加 Checkbox 复选框(暂不支持与 draggable 和 editable 同时使用) | Boolean | - | false | +| editable | 节点右键可编辑(添加同级节点、添加子节点、编辑节点、删除节点) | Boolean | - | false | +| draggable | 节点可拖拽 | Boolean | - | false | +| searchable | 节点可搜索 | Boolean | - | false | +| options | 配置选项 | Object | 参见 Tree Attributes-options | - | +| origin | 异步加载配置项 | Object | 参见 Tree Attributes-origin | - | +| defaultExpandAll | 是否默认展开所有树节点 | Boolean | - | false | +| checkedKeys | 默认选中的 checkbox | Array | - | - | +| openIcon | 表示展开的图标 | String | Icon 图标名称 | - | +| closeIcon | 表示闭合的图标 | String | Icon 图标名称 | - | +| style | 组件整体样式 | Object | - | - | +| highlightable | 高亮 | Boolean | - | - | +| onChange | 改变复选框状态时触发 | Function(checkedArr:Array, title: String, isChecked: Boolean) | - | - | +| onNodeToggle | 节点被点击(展开/收起)时触发 | Function(data: Obejct, isExpanded: Boolean) | - | - | +| onCheckChange | 节点选中项 | Funciton(checkedArr: Array, title: String, isChecked: Boolean) | - | - | +| onCheck | 点击节点多选框触发 | Funciton(checkedArr: Array, item: Object, isChecked: Boolean) | - | - | +| onDragStart | 节点开始拖拽时触发 | Funciton(dragNode: Object) | - | - | +| onDrop | 节点拖拽成功时触发 | Funciton(dragNode: Object, dropNode: Object) | - | - | +| onDelete | 节点删除时触发 | Funciton(deleteNode: Object, data: Object) | - | - | +| onSave | 节点保存新增、编辑状态时触发 | Funciton(editNode: Object, data: Object) | - | - | + +### Tree Attributes-data + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ----------- | ------------------------------------------------------------------ | -------- | ------ | ------ | +| expanded | 默认是否展开子菜单(优先级高于 defaultExpandAll) | Boolean | - | - | +| onClick | 点击每项时触发的事件 | Function | - | - | +| onNodeClick | 点击每项时触发,onClick 作用具体绑定的项,onNodeClick 作用于所以项 | Function | - | - | +| style | 单个节点样式 | Object | - | - | + +### Tree Attributes-origin + +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| ------------ | ---------------------------------------------------------- | --------------- | ----------- | ------ | +| method | 异步请求的方法 | String | get \| post | get | +| url | 异步请求的 url | String | - | - | +| headers | 异步请求的请求头 | Object | - | - | +| data | post 请求时的请求体 | Object | - | - | +| params | 异步请求时的 url 参数 | Object | - | - | +| func | 对异步请求结果进行加工处理的函数,返回结果用于生成子节点项 | Function(data) | - | - | +| errorHandler | 对异步请求错误进行自定义处理的函数 | Function(error) | - | - | + +### Tree Attributes-options +| 参数 | 说明 | 类型 | 可选值 | 默认值 | +| -------- | ---------------------------------- | ------ | ------ | -------- | +| title | 指定节点标签为节点对象的某个属性值 | String | - | title | +| children | 指定子树为节点对象的某个属性值 | String | - | children | diff --git a/package.json b/package.json index 3745c6a32..836ba8657 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hi-ui/hiui", - "version": "1.4.6", + "version": "1.5.0", "description": "HIUI for React", "scripts": { "test": "node_modules/.bin/standard && node_modules/.bin/stylelint --config .stylelintrc 'components/**/*.scss'", @@ -47,6 +47,8 @@ "react": "^16.3.2", "react-addons-css-transition-group": "^15.6.2", "react-click-outside": "^3.0.1", + "react-dnd": "^7.4.5", + "react-dnd-html5-backend": "^7.4.4", "react-dom": "^16.3.2", "react-lifecycles-compat": "^3.0.4", "react-redux": "^5.0.7", @@ -65,7 +67,7 @@ "@babel/standalone": "^7.3.3", "autoprefixer": "^8.5.0", "babel-eslint": "^10.0.1", - "babel-jest": "^24.1.0", + "babel-jest": "^24.8.0", "babel-loader": "^8.0.5", "babel-plugin-transform-decorators-legacy": "^1.3.4", "babel-plugin-transform-remove-console": "^6.9.4", @@ -83,7 +85,7 @@ "gulp-babel": "^8.0.0", "html-webpack-plugin": "^3.2.0", "husky": "^0.14.3", - "jest": "^24.1.0", + "jest": "^24.8.0", "jest-fetch-mock": "^2.1.1", "jsx-loader": "^0.13.2", "lint-staged": "^7.2.2", @@ -93,6 +95,7 @@ "postcss-loader": "^2.1.5", "prismjs": "^1.14.0", "raw-loader": "^0.5.1", + "react-custom-scrollbars": "^4.2.1", "react-hot-loader": "4.2.0", "react-test-renderer": "^16.8.2", "rimraf": "^2.6.2", @@ -113,6 +116,9 @@ "webpack-dev-server": "^3.1.12" }, "standard": { + "env": [ + "jest" + ], "parser": "babel-eslint", "ignore": [ "/es/", diff --git a/site/locales/en-US.js b/site/locales/en-US.js index 1ab96d4f1..fb6645a38 100644 --- a/site/locales/en-US.js +++ b/site/locales/en-US.js @@ -42,7 +42,12 @@ module.exports = { grid: 'Grid', stepper: 'Stepper', icon: 'Icon', - progress: 'Progress' + progress: 'Progress', + card: 'Card', + timeline: 'Timeline', + transfer: 'Transfer', + switch: 'Switch', + rate: 'Rate' }, designs: { 'design-patterns': '设计模式', diff --git a/site/locales/zh-CN.js b/site/locales/zh-CN.js index 8ff0618b6..96f433dc0 100755 --- a/site/locales/zh-CN.js +++ b/site/locales/zh-CN.js @@ -42,7 +42,12 @@ module.exports = { grid: 'Grid 栅格', stepper: 'Stepper 步骤', icon: 'Icon 图标', - progress: 'Progress 进度条' + progress: 'Progress 进度条', + card: 'Card 卡片', + timeline: 'Timeline 时间轴', + transfer: 'Transfer 穿梭框', + switch: 'Switch 开关', + rate: 'Rate 评分' }, designs: { 'design-patterns': '设计模式', diff --git a/site/pages/components/card/index.js b/site/pages/components/card/index.js new file mode 100644 index 000000000..e1269f0c0 --- /dev/null +++ b/site/pages/components/card/index.js @@ -0,0 +1,9 @@ +import Markdown from '../../../../libs/markdown' + +class Card extends Markdown { + document (locale) { + return require(`../../../../docs/${locale}/components/card.md`) + } +} + +export default Card diff --git a/site/pages/components/index.js b/site/pages/components/index.js index e200ba547..034bcf160 100755 --- a/site/pages/components/index.js +++ b/site/pages/components/index.js @@ -32,8 +32,8 @@ export default { 'checkbox': require('./checkbox'), 'date-picker': require('./date-picker'), 'time-picker': require('./time-picker'), - 'upload': require('./upload') - + 'upload': require('./upload'), + 'rate': require('./rate') }, 'group-data': { 'table': require('./table'), @@ -42,7 +42,11 @@ export default { 'collapse': require('./collapse'), 'tooltip': require('./tooltip'), 'popover': require('./popover'), - 'progress': require('./progress') + 'progress': require('./progress'), + 'card': require('./card'), + 'timeline': require('./timeline'), + 'transfer': require('./transfer'), + 'switch': require('./switch') }, 'group-tips': { 'modal': require('./modal'), diff --git a/site/pages/components/rate/index.js b/site/pages/components/rate/index.js new file mode 100644 index 000000000..4d5f6e9fa --- /dev/null +++ b/site/pages/components/rate/index.js @@ -0,0 +1,9 @@ +import Markdown from '../../../../libs/markdown' + +class Rate extends Markdown { + document (locale) { + return require(`../../../../docs/${locale}/components/rate.md`) + } +} + +export default Rate diff --git a/site/pages/components/switch/index.js b/site/pages/components/switch/index.js new file mode 100755 index 000000000..5bf34d2c0 --- /dev/null +++ b/site/pages/components/switch/index.js @@ -0,0 +1,9 @@ +import Markdown from '../../../../libs/markdown' + +class Switch extends Markdown { + document (locale) { + return require(`../../../../docs/${locale}/components/switch.md`) + } +} + +export default Switch diff --git a/site/pages/components/timeline/index.js b/site/pages/components/timeline/index.js new file mode 100644 index 000000000..b65ad7435 --- /dev/null +++ b/site/pages/components/timeline/index.js @@ -0,0 +1,9 @@ +import Markdown from '../../../../libs/markdown' + +class Timeline extends Markdown { + document (locale) { + return require(`../../../../docs/${locale}/components/timeline.md`) + } +} + +export default Timeline diff --git a/site/pages/components/transfer/index.js b/site/pages/components/transfer/index.js new file mode 100755 index 000000000..414284966 --- /dev/null +++ b/site/pages/components/transfer/index.js @@ -0,0 +1,9 @@ +import Markdown from '../../../../libs/markdown' + +class Transfer extends Markdown { + document (locale) { + return require(`../../../../docs/${locale}/components/transfer.md`) + } +} + +export default Transfer diff --git a/site/view/Home/style/index.scss b/site/view/Home/style/index.scss index 8119b9127..20fd441f5 100644 --- a/site/view/Home/style/index.scss +++ b/site/view/Home/style/index.scss @@ -4,9 +4,9 @@ $primary-color: get-color($palette-primary, 'hiui-blue') !default; $imgurl: '../../../static/img/home/' !default; .layout--classic { - .layout__header { - z-index: 1999; - } + // .layout__header { + // z-index: 1999; + // } .layout__main { // 默认情况下,元素不会缩短至小于内容框尺寸,若想改变这一状况,请设置元素的min-width flex: 0 1 auto; // overflow: hidden;