perf(checkbox): 新增 disabled 禁用状态
This commit is contained in:
		
							parent
							
								
									d63173a4c8
								
							
						
					
					
						commit
						d72d93dba4
					
				| @ -199,11 +199,7 @@ export default { | |||||||
| 
 | 
 | ||||||
| ::: | ::: | ||||||
| 
 | 
 | ||||||
| ::: field button attributes | | Name   | Description | Accepted Values                          | | ||||||
| 
 |  | ||||||
| ::: |  | ||||||
| 
 |  | ||||||
| |        |        |                                               | |  | ||||||
| | ------ | ------ | --------------------------------------------- | | | ------ | ------ | --------------------------------------------- | | ||||||
| | type   | 主题   | `primary` `normal` `warm` `danger` `disabled` | | | type   | 主题   | `primary` `normal` `warm` `danger` `disabled` | | ||||||
| | size   | 尺寸   | `lg` `sm` `xs`                                | | | size   | 尺寸   | `lg` `sm` `xs`                                | | ||||||
|  | |||||||
| @ -89,7 +89,7 @@ import { ref } from 'vue' | |||||||
| export default { | export default { | ||||||
|   setup() { |   setup() { | ||||||
| 
 | 
 | ||||||
|     const disabled = ref(false) |     const disabled = ref(true) | ||||||
| 
 | 
 | ||||||
|     return { |     return { | ||||||
|       disabled |       disabled | ||||||
|  | |||||||
| @ -1047,11 +1047,7 @@ export default { | |||||||
| 
 | 
 | ||||||
| ::: | ::: | ||||||
| 
 | 
 | ||||||
| ::: field icon attributes | | Name   | Description | Default Value  | | ||||||
| 
 |  | ||||||
| ::: |  | ||||||
| 
 |  | ||||||
| |      |      |                   | |  | ||||||
| | ---- | ---- | ----------------- | | | ---- | ---- | ----------------- | | ||||||
| | type | 图标 | `layui-icon-home` | | | type | 图标 | `layui-icon-home` | | ||||||
| | prefix | 前缀 | `layui-icon` | | | prefix | 前缀 | `layui-icon` | | ||||||
|  | |||||||
| @ -277,3 +277,7 @@ table td { | |||||||
| .anim .site-doc-icon li .code { | .anim .site-doc-icon li .code { | ||||||
|   white-space: nowrap; |   white-space: nowrap; | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | .markdown-body th { | ||||||
|  |   text-align: left; | ||||||
|  | } | ||||||
| @ -2,18 +2,11 @@ | |||||||
|   <span @click.stop="handleClick"> |   <span @click.stop="handleClick"> | ||||||
|     <input type="checkbox" :name="name" :value="label" /> |     <input type="checkbox" :name="name" :value="label" /> | ||||||
|     <div |     <div | ||||||
|       class="layui-unselect" |       class="layui-unselect layui-form-checkbox" | ||||||
|       :class="[ |       :class="{ | ||||||
|         { |  | ||||||
|         'layui-checkbox-disbaled layui-disabled': disabled, |         'layui-checkbox-disbaled layui-disabled': disabled, | ||||||
|         }, |         'layui-form-checked': needCustomChecked ? customChecked : props.checked, | ||||||
|         { |       }" | ||||||
|           'layui-form-checked': needCustomChecked |  | ||||||
|             ? customChecked |  | ||||||
|             : props.checked, |  | ||||||
|         }, |  | ||||||
|         'layui-form-checkbox', |  | ||||||
|       ]" |  | ||||||
|       :lay-skin="skin" |       :lay-skin="skin" | ||||||
|     > |     > | ||||||
|       <span><slot /></span> |       <span><slot /></span> | ||||||
| @ -31,7 +24,7 @@ const props = | |||||||
|     skin?: string |     skin?: string | ||||||
|     label?: string |     label?: string | ||||||
|     checked?: Boolean |     checked?: Boolean | ||||||
|     disabled?: boolean |     disabled?: Boolean | ||||||
|   }>() |   }>() | ||||||
| 
 | 
 | ||||||
| const customChecked = ref(false) | const customChecked = ref(false) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user