1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <template lang="html">
- <div class="base-input__wrapper">
- <label class="base-input__label" v-if="label">
- {{ label }}
- </label>
- <input
- :value="value"
- @input="updateValue"
- v-on="listeners"
- :v-bind="$attrs"
- :class="'base-input ' + className"
- :type="inputType"
- @keyup.enter="keyupEnter"
- />
- </div>
- </template>
- <script>
- export default {
- inheritAttrs: false,
- props: {
- inputType: {
- type: String,
- default: "text"
- },
- label: {
- type: String,
- defaul: "",
- },
- value: [String, Number],
- className: {
- type: String
- }
- },
- methods: {
- updateValue(event) {
- this.$emit("input", event.target.value);
- },
- keyupEnter() {
- this.$emit("keyupEnter");
- }
- },
- computed: {
- listeners() {
- return {
- ...this.$listeners,
- input: this.updateValue,
- };
- },
- },
- };
- </script>
- <style lang="less">
- </style>
|