view.jsx 707 B

12345678910111213141516
  1. import BasicNumberView from '../../basic/number/view'
  2. import { useFormView } from '../../../hooks/form-input'
  3. import { formInputViewProps } from '../../form-input-props'
  4. import './index.less'
  5. export default {
  6. name: 'ToleranceNumberView',
  7. props: formInputViewProps,
  8. setup (props) {
  9. const { proxyOtherValue, width } = useFormView(props)
  10. return () => <div class={'extension-tolerance-number'} style={{ width: width.value }}>
  11. <BasicNumberView modelValue={props.modelValue} config={props.config}/>
  12. <span class={'extension-tolerance-number__joint'}>±</span>
  13. <BasicNumberView modelValue={proxyOtherValue[0].value} config={{ ...props.config, noPrecision: true }}/>
  14. </div>
  15. }
  16. }