Skip to content

Custom methods for text interpolation #5574

@o-alexandrov

Description

@o-alexandrov

What problem does this feature solve?

It will allow to create custom methods(filters) for text interpolation.
Declare those methods as Actions, for example, in vuex and map them app-wide.
Thus, there would be no need in importing libraries.

What does the proposed API look like?

For example, a developer could simply add the following function as a method:

numberWithCommas(x) {
    return x.toString().replace(/\B(?=(\d{3}) (?!\d))/g, ",");
}

And then, inside the mustache syntax do the following:

{{ number.numberWithCommas }}

That would call the function and return a formatted number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions