How to use the weex-template-compiler.parseComponent function in weex-template-compiler

To help you get started, we’ve selected a few weex-template-compiler 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 dcloudio / uni-app / packages / vue-cli-plugin-hbuilderx / packages / webpack-uni-nvue-loader / lib / main.js View on Github external
function getAppStyleCode(stringifyRequest) {
  if (!process.env.UNI_USING_NVUE_COMPILER) {
    return ''
  }
  let code = 'App.appStyle = {}\n'
  let styles = []
  try {
    if (fs.existsSync(appVuePath)) {
      styles = parseComponent(fs.readFileSync(appVuePath, 'utf8')).styles
    }
  } catch (e) {}
  styles.forEach((style, index) => {
    code = code +
      `Vue.prototype.__merge_style(require(${genStyleRequest(style,index,stringifyRequest)}).default,App.appStyle)\n`
  })
  return code
}

weex-template-compiler

Weex template compiler for Vue 2.0

MIT
Latest version published 6 years ago

Package Health Score

73 / 100
Full package analysis

Popular weex-template-compiler functions