File tree Expand file tree Collapse file tree
src/components/c-cascader/demos Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,17 +7,19 @@ desc: 默认样式
77``` jsx
88
99import React , { useState , useEffect } from ' react' ;
10- import { CCascader } from ' cloud-react' ;
10+ import { CCascader , Tooltip , Icon } from ' cloud-react' ;
1111const addressOptions = [
1212 {
1313 value: ' zhejiang' ,
1414 label: ' Zhejiang' ,
15+ info: ' 说明' ,
1516
1617
1718 children: [
1819 {
1920 value: ' hangzhou' ,
2021 label: ' Hangzhou' ,
22+ info: ' 说明' ,
2123 children: [
2224 {
2325 value: ' xihu' ,
@@ -124,6 +126,18 @@ export default function Demo() {
124126 onChange= {onChange}
125127 placeholder= " Please select"
126128 style= {{ width: 328 }}
129+ optionRender= {option => {
130+ return (
131+ < label title= {option .title } style= {{ display: ' flex' , gap: 4 }}>
132+ {option .label }
133+ {option .info && (
134+ < Tooltip content= {option .info } theme= " light" placement= " right" overlayStyle= {{ zIndex: 10000 }}>
135+ < Icon type= " question-circle" / >
136+ < / Tooltip>
137+ )}
138+ < / label>
139+ );
140+ }}
127141 / >
128142 < div style= {{ marginBottom: 24 , marginTop: 40 }}> 任意选项支持选择< / div>
129143 < CCascader
You can’t perform that action at this time.
0 commit comments