Home / Function/ genProps() — vue Function Reference

genProps() — vue Function Reference

Architecture documentation for the genProps() function in index.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  d482b9b1_9071_5444_3def_14cd026c403f["genProps()"]
  4ed91472_8abf_1a34_b708_77e5a59ad407["genData()"]
  4ed91472_8abf_1a34_b708_77e5a59ad407 -->|calls| d482b9b1_9071_5444_3def_14cd026c403f
  24a4679f_fe1d_7654_49b3_ea4cfe44df1f["genSlot()"]
  24a4679f_fe1d_7654_49b3_ea4cfe44df1f -->|calls| d482b9b1_9071_5444_3def_14cd026c403f
  d3196e8b_882b_bf4e_3d23_ceb5a170b49c["transformSpecialNewlines()"]
  d482b9b1_9071_5444_3def_14cd026c403f -->|calls| d3196e8b_882b_bf4e_3d23_ceb5a170b49c
  style d482b9b1_9071_5444_3def_14cd026c403f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/compiler/codegen/index.ts lines 645–663

function genProps(props: Array<ASTAttr>): string {
  let staticProps = ``
  let dynamicProps = ``
  for (let i = 0; i < props.length; i++) {
    const prop = props[i]
    const value = transformSpecialNewlines(prop.value)
    if (prop.dynamic) {
      dynamicProps += `${prop.name},${value},`
    } else {
      staticProps += `"${prop.name}":${value},`
    }
  }
  staticProps = `{${staticProps.slice(0, -1)}}`
  if (dynamicProps) {
    return `_d(${staticProps},[${dynamicProps.slice(0, -1)}])`
  } else {
    return staticProps
  }
}

Subdomains

Called By

Frequently Asked Questions

What does genProps() do?
genProps() is a function in the vue codebase.
What does genProps() call?
genProps() calls 1 function(s): transformSpecialNewlines.
What calls genProps()?
genProps() is called by 2 function(s): genData, genSlot.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free