<template>
|
<ContentScrollView :paddingH="false">
|
<nut-form :model-value="form" ref="formRef" :rules="rules">
|
<nut-form-item label="上传照片:" class="bole-form-item alignTop" prop="imgUrl" required>
|
<Uploader
|
v-model:file-list="form.imgUrl"
|
:maximum="9"
|
:limitFileSize="10"
|
class="bole-uploader nopaddingtop"
|
>
|
</Uploader>
|
</nut-form-item>
|
</nut-form>
|
</ContentScrollView>
|
<PageFooter :isOnlyAction="false">
|
<PageFooterBtn type="primary" @click="handleSubmit()">提交</PageFooterBtn>
|
</PageFooter>
|
</template>
|
|
<script setup lang="ts">
|
import { FormRules } from '@nutui/nutui-taro/dist/types/__VUE/form/types';
|
import { FileItem } from '@nutui/nutui-taro/dist/types/__VUE/uploader/type';
|
import { FormValidator } from '@12333/utils';
|
|
defineOptions({
|
name: 'InnerPage',
|
});
|
|
const form = reactive({
|
imgUrl: [] as FileItem[],
|
});
|
|
const rules = reactive<FormRules>({
|
imgUrl: [{ required: true, message: '请上传照片', validator: FormValidator.validatorArray }],
|
});
|
|
const formRef = ref<any>(null);
|
|
function handleSubmit() {
|
if (!formRef.value) return;
|
formRef.value.validate().then(({ valid, errors }: any) => {
|
if (valid) {
|
}
|
});
|
}
|
</script>
|
|
<style lang="scss">
|
@import '@/styles/common.scss';
|
</style>
|