formatUserInput

基于传入的属性类型返回格式化程序用户输入。 如果无法识别类型,则返回输入本身。

Syntax

context.formatting.formatUserInput(input, controlAttributes);

适用于

模型驱动和画布应用

参数

参数名称 类型 必选 Description
输入 unknown 是的 用户输入。
行为 ControlAttributes 是的 controlAttributes 格式化程序使用。

返回值

类型:string

Example

const controlAttributes = {
  Type: "double",
  Precision: 2,
  PrecisionSource: 0,
  Behavior: null,
  OptionSet: null,
  Format: null,
} as ControlAttributes;

context.formatter.formatUserInput("22", controlAttributes);

格式设置
Power Apps 组件框架 API 参考
Power Apps 组件框架概述