[新增] select option 组件
This commit is contained in:
		
							parent
							
								
									895bed093c
								
							
						
					
					
						commit
						69878c2c42
					
				@ -198,7 +198,10 @@ export default {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <lay-form>
 | 
					  <lay-form>
 | 
				
			||||||
    <lay-select></lay-select>
 | 
					    <lay-select>
 | 
				
			||||||
 | 
					      <lay-select-option>北京</lay-select-option>
 | 
				
			||||||
 | 
					      <lay-select-option>济南</lay-select-option>
 | 
				
			||||||
 | 
					    </lay-select>
 | 
				
			||||||
  </lay-form>
 | 
					  </lay-form>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -40,6 +40,7 @@ import LayBreadcrumb from './module/breadcrumb/index'
 | 
				
			|||||||
import LayBreadcrumbItem from './module/breadcrumbItem/index'
 | 
					import LayBreadcrumbItem from './module/breadcrumbItem/index'
 | 
				
			||||||
import LayField from './module/field/index'
 | 
					import LayField from './module/field/index'
 | 
				
			||||||
import LaySelect from './module/select/index'
 | 
					import LaySelect from './module/select/index'
 | 
				
			||||||
 | 
					import LaySelectOption from './module/selectOption/index'
 | 
				
			||||||
import LayScroll from './module/scroll/index'
 | 
					import LayScroll from './module/scroll/index'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const components: Record<string, IDefineComponent> = {
 | 
					const components: Record<string, IDefineComponent> = {
 | 
				
			||||||
@ -80,7 +81,8 @@ const components: Record<string, IDefineComponent> = {
 | 
				
			|||||||
  LayAvatar,
 | 
					  LayAvatar,
 | 
				
			||||||
  LayField,
 | 
					  LayField,
 | 
				
			||||||
  LaySelect,
 | 
					  LaySelect,
 | 
				
			||||||
  LayScroll
 | 
					  LayScroll,
 | 
				
			||||||
 | 
					  LaySelectOption
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const install = (app: App, options?: InstallOptions): void => {
 | 
					const install = (app: App, options?: InstallOptions): void => {
 | 
				
			||||||
@ -134,6 +136,7 @@ export {
 | 
				
			|||||||
  LayField,
 | 
					  LayField,
 | 
				
			||||||
  LaySelect,
 | 
					  LaySelect,
 | 
				
			||||||
  LayScroll,
 | 
					  LayScroll,
 | 
				
			||||||
 | 
					  LaySelectOption,
 | 
				
			||||||
  install,
 | 
					  install,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -19,11 +19,7 @@
 | 
				
			|||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <dl class="layui-anim layui-anim-upbit" style="">
 | 
					    <dl class="layui-anim layui-anim-upbit" style="">
 | 
				
			||||||
      <dd lay-value="" class="layui-select-tips">请选择</dd>
 | 
					      <dd lay-value="" class="layui-select-tips">请选择</dd>
 | 
				
			||||||
      <dd lay-value="0" class="layui-this">北京</dd>
 | 
					      <slot></slot>
 | 
				
			||||||
      <dd lay-value="1" class="">上海</dd>
 | 
					 | 
				
			||||||
      <dd lay-value="2" class="">广州</dd>
 | 
					 | 
				
			||||||
      <dd lay-value="3" class="">深圳</dd>
 | 
					 | 
				
			||||||
      <dd lay-value="4" class="">杭州</dd>
 | 
					 | 
				
			||||||
    </dl>
 | 
					    </dl>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										9
									
								
								src/module/selectOption/index.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								src/module/selectOption/index.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,9 @@
 | 
				
			|||||||
 | 
					import type { App } from 'vue'
 | 
				
			||||||
 | 
					import Component from './index.vue'
 | 
				
			||||||
 | 
					import type { IDefineComponent } from '../type/index'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Component.install = (app: App) => {
 | 
				
			||||||
 | 
					  app.component(Component.name || 'LaySelectOption', Component)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export default Component as IDefineComponent
 | 
				
			||||||
							
								
								
									
										14
									
								
								src/module/selectOption/index.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								src/module/selectOption/index.vue
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
				
			|||||||
 | 
					<template>
 | 
				
			||||||
 | 
					    <dd :value="value">
 | 
				
			||||||
 | 
					        <slot></slot>
 | 
				
			||||||
 | 
					    </dd>
 | 
				
			||||||
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<script setup name="LaySelectOption" lang="ts">
 | 
				
			||||||
 | 
					import { defineProps } from 'vue'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const props =
 | 
				
			||||||
 | 
					  defineProps<{
 | 
				
			||||||
 | 
					    value?: string
 | 
				
			||||||
 | 
					  }>()
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user