mirror of https://github.com/rancher/dashboard.git
42 lines
1000 B
Vue
42 lines
1000 B
Vue
<script>
|
|
import { LabeledInput } from '@components/Form/LabeledInput';
|
|
import Question from './Question';
|
|
|
|
export default {
|
|
emits: ['update:value'],
|
|
|
|
components: { LabeledInput },
|
|
mixins: [Question]
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
:data-testid="`float-row-${question.variable}`"
|
|
class="row"
|
|
>
|
|
<div class="col span-6">
|
|
<LabeledInput
|
|
type="text"
|
|
:mode="mode"
|
|
:label="displayLabel"
|
|
:placeholder="question.default"
|
|
:required="question.required"
|
|
:value="value"
|
|
:disabled="disabled"
|
|
:tooltip="displayTooltip"
|
|
:rules="rules"
|
|
:data-testid="`float-input-${question.variable}`"
|
|
@update:value="val = parseFloat($event); if ( !isNaN(val) ) { $emit('update:value', val) }"
|
|
/>
|
|
</div>
|
|
<div
|
|
v-if="showDescription"
|
|
:data-testid="`float-description-${question.variable}`"
|
|
class="col span-6 mt-10"
|
|
>
|
|
{{ question.description }}
|
|
</div>
|
|
</div>
|
|
</template>
|