perf: 发布 0.2.3 版本
This commit is contained in:
@@ -15,10 +15,9 @@ import { defineProps, inject, useSlots } from 'vue'
|
||||
|
||||
const slot = useSlots()
|
||||
|
||||
const props =
|
||||
defineProps<{
|
||||
title: string
|
||||
}>()
|
||||
const props = defineProps<{
|
||||
title?: string
|
||||
}>()
|
||||
|
||||
const separator = inject('separator')
|
||||
</script>
|
||||
|
||||
@@ -52,9 +52,9 @@ const props = withDefaults(
|
||||
width?: string
|
||||
height?: string
|
||||
modelValue: string
|
||||
anim: string
|
||||
arrow: string
|
||||
indicator: string
|
||||
anim?: string
|
||||
arrow?: string
|
||||
indicator?: string
|
||||
}>(),
|
||||
{
|
||||
width: '100%',
|
||||
|
||||
@@ -110,15 +110,15 @@ const props = withDefaults(
|
||||
offset?: string[]
|
||||
width?: string
|
||||
height?: string
|
||||
visible?: boolean
|
||||
maxmin?: boolean
|
||||
btn: Record<string, unknown>[]
|
||||
move?: boolean
|
||||
visible?: boolean | string
|
||||
maxmin?: boolean | string
|
||||
btn?: Record<string, unknown>[]
|
||||
move?: boolean | string
|
||||
type?: number
|
||||
content?: string
|
||||
shade?: boolean
|
||||
shadeClose?: boolean
|
||||
closeBtn?: boolean
|
||||
shade?: boolean | string
|
||||
shadeClose?: boolean | string
|
||||
closeBtn?: boolean | string
|
||||
btnAlign?: string
|
||||
anim?: number
|
||||
}>(),
|
||||
@@ -139,6 +139,7 @@ const props = withDefaults(
|
||||
closeBtn: true,
|
||||
btnAlign: 'l',
|
||||
anim: 0,
|
||||
content: '',
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -62,15 +62,22 @@ const props = withDefaults(
|
||||
total: number
|
||||
limit: number
|
||||
theme?: string
|
||||
showPage?: boolean
|
||||
showSkip?: boolean
|
||||
showCount?: boolean
|
||||
showLimit?: boolean
|
||||
showInput?: boolean
|
||||
showRefresh?: boolean
|
||||
showPage?: boolean | string
|
||||
showSkip?: boolean | string
|
||||
showCount?: boolean | string
|
||||
showLimit?: boolean | string
|
||||
showInput?: boolean | string
|
||||
showRefresh?: boolean | string
|
||||
}>(),
|
||||
{
|
||||
limit: 10,
|
||||
theme: 'green',
|
||||
showPage: false,
|
||||
showSkip: false,
|
||||
showCount: false,
|
||||
showLimit: true,
|
||||
showInput: false,
|
||||
showRefresh: false,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -19,20 +19,20 @@
|
||||
</ul>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed, defineProps, Ref, ref, watch, withDefaults } from 'vue'
|
||||
import { computed, defineProps, withDefaults } from 'vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
length?: number
|
||||
modelValue: number
|
||||
character?: string
|
||||
readonly?: boolean
|
||||
readonly?: boolean | string
|
||||
theme?: string
|
||||
}>(),
|
||||
{
|
||||
length: 5,
|
||||
modelValue: 0,
|
||||
readonly: false,
|
||||
theme: 'green',
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
<template>
|
||||
<dd
|
||||
:value="value"
|
||||
:class="[selectItem.value === value ? 'layui-this' : '',disabled ? 'layui-disabled':'']"
|
||||
:class="[
|
||||
selectItem.value === value ? 'layui-this' : '',
|
||||
disabled ? 'layui-disabled' : '',
|
||||
]"
|
||||
@click="selectHandle"
|
||||
>
|
||||
{{ label }}
|
||||
@@ -10,19 +13,24 @@
|
||||
|
||||
<script setup name="LaySelectOption" lang="ts">
|
||||
import { SelectItem } from '../type'
|
||||
import { defineProps, inject, Ref } from 'vue'
|
||||
import { defineProps, inject, onMounted, Ref } from 'vue'
|
||||
|
||||
const props = defineProps<{
|
||||
value?: string
|
||||
label?: string
|
||||
disabled?: boolean
|
||||
}>()
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
value: string
|
||||
label: string
|
||||
disabled?: boolean | string
|
||||
}>(),
|
||||
{
|
||||
disabled: false,
|
||||
}
|
||||
)
|
||||
|
||||
const selectItem = inject('selectItem') as SelectItem
|
||||
const openState = inject('openState') as Ref<boolean>
|
||||
|
||||
const selectHandle = function () {
|
||||
if(props.disabled) {
|
||||
if (props.disabled) {
|
||||
return
|
||||
}
|
||||
openState.value = false
|
||||
@@ -31,8 +39,10 @@ const selectHandle = function () {
|
||||
}
|
||||
|
||||
// init selected
|
||||
if (selectItem.value === props.value) {
|
||||
selectItem.value = props.value
|
||||
selectItem.label = props.label
|
||||
}
|
||||
onMounted(() => {
|
||||
if (selectItem.value === props.value) {
|
||||
selectItem.value = props.value
|
||||
selectItem.label = props.label
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -15,7 +15,7 @@ import { computed, CSSProperties, defineProps } from 'vue'
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
width?: string
|
||||
width?: string | number
|
||||
}>(),
|
||||
{
|
||||
width: '200',
|
||||
|
||||
Reference in New Issue
Block a user