Task: Implement a globally-registered Vue 2 component named number-input that supports v-model and exposes a decrease() method used by tests to mutate the parent value.
Requirements:
Location: /app/
Create a plain JavaScript module at /app/number-input.js that, when loaded, registers a global Vue component with the tag name number-input.
The component should support v-model via the value prop and emit input events to update the parent:
Props:
value: Number, default 0
min: Number, optional
Provide a method decrease() on the component instance that:
Computes nextVal = (this.value || 0) - 1
If min is defined (i.e., typeof min === 'number') and nextVal < min, do nothing
Otherwise, emit an input event with nextVal to update the v-model (this.$emit('input', nextVal))
The component should have a minimal template (e.g., a simple span or div) since tests do not rely on rendering.
Behavior to satisfy tests:
When no min is provided, calling decrease() on value 0 should update the parent value to -1.
When min is 0 and value is 0, calling decrease() should not change the parent value (no emission).
Ensure compatibility with test usage pattern: new Vue({ template: '' }).$mount(); vm.$refs.numberInput.decrease() should update vm.value accordingly.
Optional but helpful:
Provide a small /app/index.js bootstrap (or have number-input.js self-register on load) so that the component is available as soon as /app/ is loaded in the test environment.