...
Code Block | ||
---|---|---|
| ||
<template> <Uniform @submit="submit"> <FormRow label="Name"> required> <FormText name="name" :validations="v => [v.required()]" /> </FormRow> <FormRow label="Favourite Battleship"> required> <FormRadioGroup name="battleship" :validations="v => [v.required()]"> <Radio value="hms-victory">HMS Victory</Radio> <Radio value="uss-enterprise">USS Enterprise</Radio> </FormRadioGroup> </FormRow> <FormRowActionButtons @cancel="back" /> </Uniform> </template> <script> import { Uniform, FormRow, FormText, FormRadioGroup } from 'tui/components/uniform'; import Radio from 'tui/components/form/Radio'; import FormRowActionButtons from 'tui/components/form/FormRowActionButtons'; export default { components: { Uniform, FormRow, FormText, FormRadioGroup, Radio, FormRowActionButtons }, methods: { submit(values) { console.log(values); // => { name: "Winston Churchill", battleship: "hms-victory" } }, }, }; </script> |
...