add select basic demo
							parent
							
								
									0eb2ba5864
								
							
						
					
					
						commit
						3c68faea28
					
				|  | @ -70,3 +70,9 @@ const api = { | |||
|   message, | ||||
| } | ||||
| export { api } | ||||
| 
 | ||||
| import Select from './select' | ||||
| const SelectOption = Select.Option | ||||
| const SelectOptGroup = Select.OptGroup | ||||
| export { Select, SelectOption, SelectOptGroup } | ||||
| 
 | ||||
|  |  | |||
|  | @ -0,0 +1,36 @@ | |||
| 
 | ||||
| <cn> | ||||
| #### 基本使用 | ||||
| 基本使用。 | ||||
| </cn> | ||||
| 
 | ||||
| <us> | ||||
| #### Basic Usage | ||||
| Basic Usage | ||||
| </us> | ||||
| 
 | ||||
| ```html | ||||
| <template> | ||||
|   <div> | ||||
|     <a-select defaultValue="lucy" style='width: 120px' @change='handleChange'> | ||||
|       <a-select-option value="jack">Jack</a-select-option> | ||||
|       <a-select-option value="lucy">Lucy</a-select-option> | ||||
|       <a-select-option value="disabled" disabled>Disabled</a-select-option> | ||||
|       <a-select-option value="Yiminghe">yiminghe</a-select-option> | ||||
|     </a-select> | ||||
|     <a-select defaultValue="lucy" style='width: 120px' allowClear disabled> | ||||
|       <a-select-option value="lucy">Lucy</a-select-option> | ||||
|     </a-select> | ||||
|   </div> | ||||
| </template> | ||||
| <script> | ||||
| export default { | ||||
|     methods: { | ||||
|       handleChange(value) { | ||||
|         console.log(`selected ${value}`); | ||||
|       } | ||||
|     } | ||||
| } | ||||
| </script> | ||||
| ``` | ||||
| 
 | ||||
|  | @ -3,7 +3,7 @@ import PropTypes from '../_util/vue-types' | |||
| import VcSelect, { Option, OptGroup } from '../vc-select' | ||||
| import LocaleReceiver from '../locale-provider/LocaleReceiver' | ||||
| import defaultLocale from '../locale-provider/default' | ||||
| import { getComponentFromProp } from '../_util/props-util' | ||||
| import { getComponentFromProp, getOptionProps } from '../_util/props-util' | ||||
| 
 | ||||
| const AbstractSelectProps = { | ||||
|   prefixCls: PropTypes.string, | ||||
|  | @ -101,7 +101,7 @@ export default { | |||
|         size, | ||||
|         mode, | ||||
|         ...restProps | ||||
|       } = this.$props | ||||
|       } = getOptionProps(this) | ||||
|       const cls = { | ||||
|         [`${prefixCls}-lg`]: size === 'large', | ||||
|         [`${prefixCls}-sm`]: size === 'small', | ||||
|  |  | |||
|  | @ -21,3 +21,4 @@ import './collapse/style' | |||
| import './notification/style' | ||||
| import './message/style' | ||||
| import './spin/style' | ||||
| import './select/style' | ||||
|  |  | |||
|  | @ -195,7 +195,7 @@ export default { | |||
|     }, | ||||
|     updateLabelAndTitleMap (children = []) { | ||||
|       children.forEach(child => { | ||||
|         if (!child || (child.data && child.data.slot !== undefined)) { | ||||
|         if (!child.data || child.data.slot !== undefined) { | ||||
|           return | ||||
|         } | ||||
|         if (getSlotOptions(child).isSelectOptGroup) { | ||||
|  | @ -472,7 +472,7 @@ export default { | |||
|         values = [value] | ||||
|       } | ||||
|       children.forEach(child => { | ||||
|         if (!child || (child.data && child.data.slot !== undefined)) { | ||||
|         if (!child.data || child.data.slot !== undefined) { | ||||
|           return | ||||
|         } | ||||
|         if (getSlotOptions(child).isSelectOptGroup) { | ||||
|  | @ -526,7 +526,7 @@ export default { | |||
|       } | ||||
|       let label = null | ||||
|       children.forEach(child => { | ||||
|         if (!child || (child.data && child.data.slot !== undefined)) { | ||||
|         if (!child.data || child.data.slot !== undefined) { | ||||
|           return | ||||
|         } | ||||
|         if (getSlotOptions(child).isSelectOptGroup) { | ||||
|  | @ -547,7 +547,7 @@ export default { | |||
|       } | ||||
|       let value = null | ||||
|       children.forEach(child => { | ||||
|         if (!child || (child.data && child.data.slot !== undefined)) { | ||||
|         if (!child.data || child.data.slot !== undefined) { | ||||
|           return | ||||
|         } | ||||
|         if (getSlotOptions(child).isSelectOptGroup) { | ||||
|  | @ -1159,7 +1159,7 @@ export default { | |||
|       const { inputValue } = this | ||||
|       const tags = props.tags | ||||
|       children.forEach(child => { | ||||
|         if (!child || (child.data && child.data.slot !== undefined)) { | ||||
|         if (!child.data || child.data.slot !== undefined) { | ||||
|           return | ||||
|         } | ||||
|         if (getSlotOptions(child).isSelectOptGroup) { | ||||
|  |  | |||
|  | @ -3,7 +3,7 @@ const AsyncComp = () => { | |||
|   const hashs = window.location.hash.split('/') | ||||
|   const d = hashs[hashs.length - 1] | ||||
|   return { | ||||
|     component: import(`../components/vc-select/demo/${d}.vue`), | ||||
|     component: import(`../components/select/demo/${d}.md`), | ||||
|   } | ||||
| } | ||||
| export default [ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 tjz
						tjz