(component): update

This commit is contained in:
就眠儀式
2022-10-16 10:22:17 +08:00
parent 3ff243b446
commit e181ba7ad2
6 changed files with 35 additions and 11 deletions

View File

@@ -5,7 +5,14 @@ export default {
</script>
<script setup lang="ts">
import { inject, Ref, computed, ref, ComputedRef, WritableComputedRef } from "vue";
import {
inject,
Ref,
computed,
ref,
ComputedRef,
WritableComputedRef,
} from "vue";
const props = defineProps<{
id: string;
@@ -36,7 +43,7 @@ const getStyle = computed<any>(() => {
let prevIndex = activeIndex > 0 ? activeIndex - 1 : allChildNum - 1;
let nextIndex = activeIndex + 1 < allChildNum ? activeIndex + 1 : 0;
let animation = anim.value;
if (activeIndex === currentIndex) {
if (animation === "updown") {
return {

View File

@@ -1,7 +1,7 @@
<script lang="ts">
export default {
name: "TableRow",
};
}
</script>
<script lang="ts" setup>
@@ -9,7 +9,6 @@ import { Recordable } from "../../types";
import { LayIcon } from "@layui/icons-vue";
import { computed, ref, StyleValue, useSlots, WritableComputedRef } from "vue";
import LayCheckbox from "../checkbox/index.vue";
import LayDropdown from "../dropdown/index.vue";
import LayTooltip from "../tooltip/index.vue";
import LayRadio from "../radio/index.vue";
@@ -599,8 +598,8 @@ const radioProps = props.getRadioProps(props.data, props.index);
>
<table-row
:id="id"
:index="childrenIndex"
:data="children"
:index="childrenIndex"
:columns="columns"
:indent-size="indentSize"
:current-indent-size="childrenIndentSize"

View File

@@ -18,7 +18,6 @@ import {
onBeforeUnmount,
} from "vue";
import { Recordable } from "../../types";
import { LayIcon } from "@layui/icons-vue";
import LayCheckbox from "../checkbox/index.vue";
import LayDropdown from "../dropdown/index.vue";
import LayEmpty from "../empty/index.vue";
@@ -811,11 +810,11 @@ onBeforeUnmount(() => {
</colgroup>
<tbody>
<!-- 渲染 -->
<template v-for="(data, index) in tableDataSource" :key="index">
<template v-for="(children, index) in tableDataSource" :key="index">
<table-row
:id="id"
:index="index"
:data="data"
:data="children"
:columns="tableBodyColumns"
:indent-size="indentSize"
:currentIndentSize="currentIndentSize"

View File

@@ -285,8 +285,7 @@ const filetoDataURL = (file: File, fn: Function) => {
const uploadChange = (e: any) => {
e.preventDefault();
const files = e.target.files || e.dataTransfer.files;
const _files = [...files];
const _files = [...(e.target.files || e.dataTransfer.files)];
if (props.multiple && props.number != 0 && props.number < _files.length) {
errorF(numberErrorMsg);
return;