# Returns the value of the input cost in a variable

**URL:** <https://community.weweb.io/t/returns-the-value-of-the-input-cost-in-a-variable/9217>\
**Category:** Developer corner\
**Created:** [June 20, 2024, 3:04am UTC](https://community.weweb.io/t/returns-the-value-of-the-input-cost-in-a-variable/9217 "2024-06-20T03:04:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![enzocarmo](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/enzocarmo/32/7681_2.png) [@enzocarmo](https://community.weweb.io/u/enzocarmo)\
**Post date:** [June 20, 2024, 3:04am UTC](https://community.weweb.io/t/returns-the-value-of-the-input-cost-in-a-variable/9217/1 "2024-06-20T03:04:16Z")

</div>

Well, as we know, when we put a value in the weweb io input, we can use it in formulas through variables.

I’m trying to make a custom component with Primevue, so far I managed to import an input from Primevue, the problem I found nowhere explaining how to return the value of the input in weweb io. I even tried looking in the component codes on github, but there are many lines with different functions, which makes it difficult to understand.

```auto
<template>
  <div>
    <InputNumber 
      v-model="inputValue" 
      inputId="currency-br" 
      mode="currency" 
      currency="BRL" 
      locale="pt-BR" 
      unstyled
      :placeholder="content.placeholder" 
    />
    <p>{{ inputValue }}</p>
  </div>
</template>

<script>
import InputNumber from 'primevue/inputnumber';

export default {
  components: {
    InputNumber
  },
  props: {
    content: { 
      type: Object, 
      required: true 
    },
    value: { 
      type: Number, 
      required: true 
    }
  },
  data() {
    return {
      inputValue: this.value // Inicialize inputValue com o valor da prop value
    };
  },
  watch: {
    inputValue(newValue) {
      this.$emit('input', newValue); // Emita um evento de input sempre que inputValue mudar
    },
    value(newValue) {
      this.inputValue = newValue; // Atualize inputValue se a prop value mudar externamente
    }
  }
};
</script>

<style scoped>
::v-deep #currency-br::placeholder {
  color: white;
}

::v-deep #currency-br {
  height: 50px;
  background-color: #b1b1b1;
  width: 100%;
  color: white; /* Caso queira a cor do texto também branca */
  border-radius: 16px;
  border: 0;
}
</style>

```

So far I’m getting the input value, but I’m not getting it to show in the editor, does anyone know how to help me?

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorilama/32/10403_2.png) [@dorilama](https://community.weweb.io/u/dorilama)\
**Post date:** [June 20, 2024, 10:55am UTC](https://community.weweb.io/t/returns-the-value-of-the-input-cost-in-a-variable/9217/2 "2024-06-20T10:55:17Z")

</div>

Since you are building an input have you read the code of weweb’s input element? it’s open source on github, it’s actually a manageable size to read and you learn a lot of useful stuff for developing custom code components in weweb.

> **[GitHub - weweb-assets/ww-input-basic](https://github.com/weweb-assets/ww-input-basic)**
>
> Contribute to weweb-assets/ww-input-basic development by creating an account on GitHub.

assuming you are with vue, what you are looking for is [here](https://github.com/weweb-assets/ww-input-basic/blob/620233a9c79788ef97a715e5840a4da46508d0d9/src/wwElement.vue#L102) in the setup function.
