Skip to content

Instantly share code, notes, and snippets.

@jaydson
Created March 22, 2021 15:03
Show Gist options
  • Select an option

  • Save jaydson/ac2e010a291f32eb454a49e8b83ad71b to your computer and use it in GitHub Desktop.

Select an option

Save jaydson/ac2e010a291f32eb454a49e8b83ad71b to your computer and use it in GitHub Desktop.

Revisions

  1. Jaydson Gomes created this gist Mar 22, 2021.
    22 changes: 22 additions & 0 deletions custom-input-8.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <!-- CustomInput.vue -->
    <template>
    ...
    <input type="text" :name="name" v-model="model" />
    ...
    </template>

    <script>
    ...
    computed: {
    ...
    model: {
    get() {
    return this.value;
    },
    set(value) {
    this.$emit('input', value);
    },
    },
    },
    ...
    </script>