D
D
Dima Pautov2017-07-10 10:27:24
JavaScript
Dima Pautov, 2017-07-10 10:27:24

Is it necessary to register tag attributes as properties on a vue.js component?

Good morning! I wondered whether it is necessary to write all the attributes of the tag into the properties of the component?
For example: I made a component with an input field:

<template>
  <input
    class="field"
    :type="type"
    :name="name"
    :value="value"
    :disabled="disabled"
    :required="required"
    :placeholder="placeholder"
    :maxlength="maxlength"
    :readonly="readonly"
  >
</template>

Here I did not specify the id attribute. Is it necessary to indicate it? Well, similar cases with other tags.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2017-07-10
@Fragster

No. Well, right off the bat I advise you to read about v-model

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question