UNPKG

mt-ui-components-vue3

Version:

玛果添实UI组件库(Vue3)

60 lines 2.05 kB
/* Analyzed bindings: { "value": "props", "name": "props", "ref": "setup-const", "watch": "setup-const", "FormItem": "setup-maybe-ref", "InputNumber": "setup-maybe-ref", "props": "setup-reactive-const", "emit": "setup-const", "scale": "setup-ref", "change": "setup-const" } */ import { defineComponent as _defineComponent } from 'vue'; import { unref as _unref, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock } from "vue"; import { ref, watch } from 'vue'; import { FormItem, InputNumber } from '../../../components'; const __sfc_main__ = _defineComponent({ props: { value: { type: Number, default: undefined, }, name: { type: String, default: 'scale', }, }, emits: ['update:value'], setup(__props, { emit }) { const props = __props; const scale = ref(0); const change = () => { emit('update:value', scale.value); }; watch(() => props.value, () => { scale.value = props.value; }, { immediate: true }); return (_ctx, _cache) => { return (_openBlock(), _createBlock(_unref(FormItem), { label: "精度", name: __props.name }, { default: _withCtx(() => [ _createVNode(_unref(InputNumber), { value: scale.value, "onUpdate:value": _cache[0] || (_cache[0] = ($event) => ((scale).value = $event)), style: { "width": "100%" }, precision: 0, min: 0, max: 99, placeholder: "请输入0-99以内的整数", onChange: change }, null, 8 /* PROPS */, ["value"]) ]), _: 1 /* STABLE */ }, 8 /* PROPS */, ["name"])); }; } }); export default __sfc_main__;