perf: 发布 0.2.3 版本

This commit is contained in:
就眠仪式
2021-11-08 00:54:38 +08:00
parent 45bfa46a4a
commit b2e6afd7b3
8 changed files with 61 additions and 37 deletions

View File

@@ -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>

View File

@@ -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%',

View File

@@ -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: '',
}
)

View File

@@ -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,
}
)

View File

@@ -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',
}
)

View File

@@ -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>

View File

@@ -15,7 +15,7 @@ import { computed, CSSProperties, defineProps } from 'vue'
const props = withDefaults(
defineProps<{
width?: string
width?: string | number
}>(),
{
width: '200',