fix: 限制文件和文件夹名称为空

This commit is contained in:
zhengkunwang223 2023-03-10 15:31:15 +08:00 committed by zhengkunwang223
parent 2904ed0edc
commit ddd59cd5f4
3 changed files with 2 additions and 3 deletions

View File

@ -122,7 +122,6 @@ export function loadZero(i: number) {
export function computeSize(size: number): string {
const num = 1024.0;
if (size < num) return size + ' B';
if (size < Math.pow(num, 2)) return (size / num).toFixed(2) + ' KB';
if (size < Math.pow(num, 3)) return (size / Math.pow(num, 2)).toFixed(2) + ' MB';

View File

@ -22,7 +22,7 @@
@submit.enter.prevent
>
<el-form-item :label="$t('file.name')" prop="name">
<el-input v-model="addForm.name" />
<el-input v-model.trim="addForm.name" />
</el-form-item>
<el-form-item v-if="!addForm.isDir">
<el-checkbox v-model="addForm.isLink" :label="$t('file.link')"></el-checkbox>

View File

@ -17,7 +17,7 @@
<el-input v-model="addForm.path" disabled />
</el-form-item>
<el-form-item :label="$t('file.name')" prop="newName">
<el-input v-model="addForm.newName" />
<el-input v-model.trim="addForm.newName" />
</el-form-item>
</el-form>
</el-col>