juareznasato / vuetify-money

vuetify-money
45 stars 23 forks source link

How I can add prepend-icon property? #39

Open augustocadini opened 3 years ago

augustocadini commented 3 years ago

On v-text-field we can add a prepend-icon, it is possible on vuetify-money?

<v-text-field
          v-money="money"
          :rules="[rules.min]"
          v-model="paymentValue"
          label="Valor R$ (pagamento)"
          prepend-icon="attach_money"
        />
augustocadini commented 3 years ago

Solved:

v-bind:prepend-icon="icon"

props: {
    icon:  {
      type: String,
      default: "attach_money"
    },...
juareznasato commented 3 years ago

Hi!! You can try this way:

properties: {
  hint: "my hint",
  'prepend-icon'="attach_money"
  // You can add other v-text-field properties, here.
},
augustocadini commented 3 years ago

Hi!! You can try this way:

properties: {
  hint: "my hint",
  'prepend-icon'="attach_money"
  // You can add other v-text-field properties, here.
},

Where are I put this properties?. Can show full example?

juareznasato commented 3 years ago
<template>
  <div>
    <vuetify-money
      v-model="value"
      v-bind:label="label"
      v-bind:placeholder="placeholder"
      v-bind:readonly="readonly"
      v-bind:disabled="disabled"
      v-bind:outlined="outlined"
      v-bind:clearable="clearable"
      v-bind:valueWhenIsEmpty="valueWhenIsEmpty"
      v-bind:options="options"
      v-bind:properties="properties"
    />
    Parent v-model: {{ value }}
  </div>
</template>
<script>
export default {
  data: () => ({
    value: "1234567.89",
    label: "Value",
    placeholder: " ",
    readonly: false,
    disabled: false,
    outlined: true,
    clearable: true,
    valueWhenIsEmpty: "",
    options: {
      locale: "pt-BR",
      prefix: "R$",
      suffix: "",
      length: 11,
      precision: 2
    },
    properties: {
      hint: "my hint"
      'prepend-icon'="mdi-..."
      // You can add other v-text-field properties, here.
    },
  })
};
</script>