Fix events in another component
This commit is contained in:
parent
4df91e7372
commit
c3fccd6cce
|
|
@ -10,28 +10,30 @@
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
data-cy="input-with-label-input"
|
data-cy="input-with-label-input"
|
||||||
class="skillbox-input"
|
class="skillbox-input"
|
||||||
@input="$emit('input', $event.target.value)"
|
@input="input"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup lang="ts">
|
||||||
export default {
|
export interface Props {
|
||||||
props: {
|
value?: string;
|
||||||
value: {
|
label?: string;
|
||||||
type: String,
|
placeholder?: string;
|
||||||
default: '',
|
}
|
||||||
},
|
withDefaults(defineProps<Props>(), {
|
||||||
label: {
|
value: '',
|
||||||
type: String,
|
label: '',
|
||||||
default: '',
|
placeholder: ''
|
||||||
},
|
});
|
||||||
placeholder: {
|
|
||||||
type: String,
|
const emit = defineEmits(['input']);
|
||||||
default: '',
|
|
||||||
},
|
const input = (event: Event) => {
|
||||||
},
|
const value = (event.target as HTMLInputElement).value;
|
||||||
};
|
console.log(value);
|
||||||
|
emit('input', value);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue