[新增] select option 组件
This commit is contained in:
@@ -40,6 +40,7 @@ import LayBreadcrumb from './module/breadcrumb/index'
|
||||
import LayBreadcrumbItem from './module/breadcrumbItem/index'
|
||||
import LayField from './module/field/index'
|
||||
import LaySelect from './module/select/index'
|
||||
import LaySelectOption from './module/selectOption/index'
|
||||
import LayScroll from './module/scroll/index'
|
||||
|
||||
const components: Record<string, IDefineComponent> = {
|
||||
@@ -80,7 +81,8 @@ const components: Record<string, IDefineComponent> = {
|
||||
LayAvatar,
|
||||
LayField,
|
||||
LaySelect,
|
||||
LayScroll
|
||||
LayScroll,
|
||||
LaySelectOption
|
||||
}
|
||||
|
||||
const install = (app: App, options?: InstallOptions): void => {
|
||||
@@ -134,6 +136,7 @@ export {
|
||||
LayField,
|
||||
LaySelect,
|
||||
LayScroll,
|
||||
LaySelectOption,
|
||||
install,
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,7 @@
|
||||
</div>
|
||||
<dl class="layui-anim layui-anim-upbit" style="">
|
||||
<dd lay-value="" class="layui-select-tips">请选择</dd>
|
||||
<dd lay-value="0" class="layui-this">北京</dd>
|
||||
<dd lay-value="1" class="">上海</dd>
|
||||
<dd lay-value="2" class="">广州</dd>
|
||||
<dd lay-value="3" class="">深圳</dd>
|
||||
<dd lay-value="4" class="">杭州</dd>
|
||||
<slot></slot>
|
||||
</dl>
|
||||
</div>
|
||||
</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>
|
||||
Reference in New Issue
Block a user