How to use the vue-native-template-compiler.parseComponent function in vue-native-template-compiler

To help you get started, we’ve selected a few vue-native-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 GeekyAnts / vue-native-core / packages / vue-native-scripts / build.js View on Github external
function compileVueToRn(resource) {
  var code = resource.toString();
  var cparsed = compiler.parseComponent(code, { pad: 'line' });

  var output = '';
  var mappings = '';

  // add react-vue import
  output += "import " + (constants.VUE) + ", { observer as " + (constants.OBSERVER) + " } from 'vue-native-core'";
  output += '\n';

  // // add react import
  // output += `import ${constants.REACT} from 'react'`
  // output += '\n';

  // add react-native import
  output += "import " + (constants.REACT_NATIVE) + " from 'react-native'";
  output += '\n';
github GeekyAnts / vue-native-core / src / platforms / vue-native / scripts / compiler.js View on Github external
export function compileVueToRn(resource) {
  const code = resource.toString();
  const cparsed = compiler.parseComponent(code, { pad: 'line' });

  let output = '';
  let mappings = '';

  // add react-vue import
  output += `import ${constants.VUE}, { observer as ${
    constants.OBSERVER
    } } from 'vue-native-core'`;
  output += '\n';

  // // add react import
  // output += `import ${constants.REACT} from 'react'`
  // output += '\n';

  // add react-native import
  output += `import ${constants.REACT_NATIVE} from 'react-native'`;

vue-native-template-compiler

Vue Native template compiler, dependency of vue-native-scripts. It can also be used as a stand-alone compiler

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis