bkp
This commit is contained in:
parent
8c5a31ef30
commit
a693081023
34 changed files with 14887 additions and 1146 deletions
|
|
@ -5,13 +5,13 @@
|
|||
class="eli-tabela__celula-link"
|
||||
@click.stop.prevent="dados.acao()"
|
||||
>
|
||||
{{ String(dados?.numero).replace('.', ',') }}
|
||||
{{ textoNumero }}
|
||||
</button>
|
||||
<span v-else>{{ String(dados?.numero).replace('.', ',') }}</span>
|
||||
<span v-else>{{ textoNumero }}</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, PropType } from "vue"
|
||||
import { computed, defineComponent, PropType } from "vue"
|
||||
import type { TiposTabelaCelulas } from "./tiposTabelaCelulas";
|
||||
|
||||
export default defineComponent({
|
||||
|
|
@ -21,16 +21,21 @@ export default defineComponent({
|
|||
dados: {
|
||||
type: Object as PropType<TiposTabelaCelulas["numero"]>,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
},
|
||||
setup({ dados }) {
|
||||
return { dados }
|
||||
const textoNumero = computed(() => {
|
||||
// Mantemos o comportamento anterior (trocar "." por ","), mas agora suportamos prefixo/sufixo.
|
||||
const numero = String(dados?.numero).replace(".", ",");
|
||||
const prefixo = dados?.prefixo?.trim();
|
||||
const sufixo = dados?.sufixo?.trim();
|
||||
|
||||
const inicio = prefixo ? `${prefixo} ` : "";
|
||||
const fim = sufixo ? ` ${sufixo}` : "";
|
||||
|
||||
return `${inicio}${numero}${fim}`;
|
||||
});
|
||||
|
||||
return { dados, textoNumero }
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue