How to use the @tarojs/shared.createMiniComponents function in @tarojs/shared

To help you get started, we’ve selected a few @tarojs/shared examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NervJS / taro / packages / taro-mini-runner / src / template / index.ts View on Github external
function buildTemplate (level: number, supportRecursive: boolean, restart = false) {
  const miniComponents = createMiniComponents(internalComponents, Adapter.type === BUILD_TYPES.ALIPAY)
  const components = Object.keys(miniComponents).filter(c => componentConfig.includes.size ? componentConfig.includes.has(c) : true)
  let template = ''

  for (const nodeName of components) {
    const attributes: Attributes = miniComponents[nodeName]
    template += buildComponentTemplate({ nodeName, attributes }, level, supportRecursive)
  }

  template += buildPlainTextTemplate(level)
  template += buildThirdPartyTemplate(level, supportRecursive)
  template += buildContainerTemplate(level, restart)

  return template
}