index.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { css } from "@linaria/core";
  2. import { defineComponent, reactive } from "vue";
  3. import { useList } from "@/modules/list";
  4. import { Button, Card, Form, Input, Radio, InputNumber } from "ant-design-vue";
  5. const layout = {
  6. labelCol: { span: 6 },
  7. wrapperCol: { span: 18 },
  8. };
  9. export default defineComponent({
  10. setup() {
  11. const { store, showModal } = useList();
  12. const formState = reactive({
  13. ...store.animate,
  14. });
  15. const submit = () => {
  16. console.log(1);
  17. };
  18. return () => (
  19. <div class={ViewStyle}>
  20. <Form {...layout} class={"setting_form"} onSubmit={submit}>
  21. <Form.Item label="滚动方向">
  22. <Radio.Group v-model={[formState.scrollType, "value"]}>
  23. <Radio.Button value="horizontal">横向</Radio.Button>
  24. <Radio.Button value="vertical">纵向</Radio.Button>
  25. </Radio.Group>
  26. </Form.Item>
  27. <Form.Item label="滚动条数">
  28. <InputNumber
  29. v-model={[formState.totalLines, "value"]}
  30. min={1}
  31. step={1}
  32. />
  33. </Form.Item>
  34. <Form.Item label="滚动速度">
  35. <InputNumber
  36. v-model={[formState.scrollSpeed, "value"]}
  37. min={1}
  38. step={1}
  39. />
  40. </Form.Item>
  41. <Form.Item wrapperCol={{ offset: 6, span: 18 }}>
  42. <Button type="primary" htmlType="submit">
  43. 保存设置
  44. </Button>
  45. </Form.Item>
  46. </Form>
  47. </div>
  48. );
  49. },
  50. });
  51. const ViewStyle = css`
  52. padding: 20px;
  53. .setting_form {
  54. width: 300px;
  55. }
  56. `;