Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: ProForm #241

Merged
merged 9 commits into from
Aug 22, 2022
Merged

feat: ProForm #241

merged 9 commits into from
Aug 22, 2022

Conversation

sunshineLixun
Copy link
Contributor

// main.[js|ts]
import "@ant-design-vue/pro-form/dist/style.css"; // pro-form css or style.less
<template>
  <QueryFilter
    :model="formModel"
    @finish="handleSubmit"
    @collapsed="onCollapsed"
  >
    <FormItem name="name" label="应用名称" required>
      <Input v-model:value="formModel.name" placeholder="请输入" allow-clear />
    </FormItem>
    <FormItem name="creater" label="创建人" required>
      <Input v-model:value="formModel.creater" placeholder="请输入" />
    </FormItem>
    <FormItem name="sex" label="性别" required>
      <Select v-model:value="formModel.sex">
        <SelectOption
          v-for="item in sex"
          :key="item.value"
          :value="item.value"
          >{{ item.label }}</SelectOption
        >
      </Select>
    </FormItem>
    <FormItem name="status" label="应用状态">
      <Input v-model:value="formModel.status" placeholder="请输入" />
    </FormItem>
    <FormItem name="startDate" label="响应日期">
      <DatePicker v-model:value="formModel.startDate" placeholder="请输入" />
    </FormItem>
    <FormItem name="create" label="创建时间">
      <RangePicker
        v-model:value="formModel.create"
        :placeholder="['开始时间', '结束时间']"
      />
    </FormItem>
  </QueryFilter>
</template>

<script lang="ts" setup>
import { ref, reactive } from "vue";
import { QueryFilter } from "@ant-design-vue/pro-form";
import dayjs, { type Dayjs } from "dayjs";
import {
  FormItem,
  Input,
  Select,
  SelectOption,
  RangePicker,
  DatePicker,
} from "ant-design-vue";

const formModel = reactive({
  name: "123",
  creater: "11",
  sex: "",
  status: "",
  startDate: "",
  create: [
    dayjs("2015/01/01", "YYYY/MM/DD"),
    dayjs("2016/01/01", "YYYY/MM/DD"),
  ] as [Dayjs, Dayjs],
});
const sex = ref([
  {
    value: "",
    label: "",
  },
  {
    value: "",
    label: "",
  },
]);

function handleSubmit(params: any) {
  console.log(params);
}
function onCollapsed(collapsed: boolean) {
  console.log(collapsed);
}
</script>

@sunshineLixun sunshineLixun changed the title 新增 ProForm feat: ProForm Aug 18, 2022
@sendya sendya added good first issue Good for newcomers and removed good first issue Good for newcomers labels Aug 18, 2022
@sendya
Copy link
Member

sendya commented Aug 18, 2022

首先,感谢你的 PR,我会在 48 小时内测试并处理。

另外,想了解一下后续的情况,是否有考虑实现 Field 原子组件?

@sunshineLixun
Copy link
Contributor Author

首先,感谢你的 PR,我会在 48 小时内测试并处理。

另外,想了解一下后续的情况,是否有考虑实现 Field 原子组件?

ProTable和 Field原子组件已经在做了, ProTable大概下周会提PR。

@sendya sendya merged commit 0da3721 into vueComponent:next Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants