S
S
SPART4K2021-04-09 15:45:59
Vue.js
SPART4K, 2021-04-09 15:45:59

How to correctly split a number into digits vue js?

Hello, I have a filter

filters: {
    	format: val => `${val}`.replace(/(\d)(?=(\d{3})+([^\d]|$))/g, '$1 '),
 },

And interpolation {{ value.pre_sum }} I transform the
interpolation {{ value.pre_sum| format }} and such an error appears in the console, I can’t figure it out, please help.
[email protected]:1287 [Vue warn]: Property "format" was accessed during render but is not defined on instance.
at

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-04-09
@SPART4K

filters: {

[email protected]

I wonder what the documentation says about this? And here's what :
Filters are removed from Vue 3.0 and no longer supported.
<...>
Instead of using filters, we recommend replacing them with computed properties or methods.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question