vue-form-json-schema icon indicating copy to clipboard operation
vue-form-json-schema copied to clipboard

How to v-bind?

Open DavidBord opened this issue 3 years ago • 3 comments

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

DavidBord avatar Mar 24 '21 10:03 DavidBord

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

jarvelov avatar Mar 24 '21 11:03 jarvelov

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 avatar Mar 25 '21 07:03 DavidBord

@jarvelov can you please help?

DavidBord avatar Apr 05 '21 13:04 DavidBord