docs: 更新文档

This commit is contained in:
就眠仪式 2021-10-27 09:26:01 +08:00
parent e6cd15ea05
commit da8c0c190f
4 changed files with 21 additions and 18 deletions

View File

@ -131,12 +131,11 @@ export default {
::: :::
::: title 评分属性 ::: title 评分属性
::: :::
| | | | | | | |
| ------- | -------- | --- | | -------- | -------- | --- |
| v-model | 评分值 | -- | | v-model | 评分值 | -- |
| length | 评分长度 | -- | | length | 评分长度 | -- |
| readonly | 只读模式 | -- | | readonly | 只读模式 | -- |

View File

@ -7,9 +7,9 @@
</template> </template>
<script setup name="LayDropdownItem" lang="ts"> <script setup name="LayDropdownItem" lang="ts">
import { inject, Ref } from "vue"; import { inject, Ref } from 'vue'
const openState:Ref<boolean> = inject('openState') as Ref<boolean> const openState: Ref<boolean> = inject('openState') as Ref<boolean>
const click = function () { const click = function () {
openState.value = false openState.value = false

View File

@ -35,7 +35,9 @@ const props = withDefaults(
} }
) )
watch(props, function () { watch(
props,
function () {
rates.value = [] rates.value = []
for (let index = 0; index < props.length; index++) { for (let index = 0; index < props.length; index++) {
rates.value.push(false) rates.value.push(false)
@ -43,7 +45,9 @@ watch(props, function () {
for (let index = props.modelValue - 1; index >= 0; index--) { for (let index = props.modelValue - 1; index >= 0; index--) {
rates.value[index] = true rates.value[index] = true
} }
},{deep: true, immediate: true}) },
{ deep: true, immediate: true }
)
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])