Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to v-bind? #93

Open
DavidBord opened this issue Mar 24, 2021 · 3 comments
Open

How to v-bind? #93

DavidBord opened this issue Mar 24, 2021 · 3 comments

Comments

@DavidBord
Copy link

For example, how to achieve the
:md-format="toUppercase"
Functionality described in https://vuematerial.io/components/chips?

@jarvelov
Copy link
Owner

jarvelov commented Mar 24, 2021

Hi,

You would need to pass md-format as a prop to the component. The prop would need to be a function which does the uppercase transformation.

{
  "component": "md-chips",
  "fieldOptions:" {
    "props": {
      "md-format": (string) => String(string).toUpperCase(),
    }
  }
}

There's unfortunately no way to use any of Vue's built in directives here, all transformations must be done with javascript functions. You can refer to Vue's documentation for more info about this limitation

@DavidBord
Copy link
Author

Thank you for your quick response.
Unfortunately, this does not work for my use case.
What I am trying to format with md-chips is a formatted object from a dialog response.
Every time md-format is called, its input is an empty string but what's rendered eventually on the screen is the entire returned object.

@DavidBord
Copy link
Author

@jarvelov can you please help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants