nvue.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getNVueFlexDirection = exports.getNVueStyleCompiler = exports.getNVueCompiler = exports.initNVue = void 0;
  4. function initNVue(manifestJson, pagesJson) { }
  5. exports.initNVue = initNVue;
  6. function getNVueCompiler(manifestJson) {
  7. const platformOptions = manifestJson['app-plus'];
  8. if (platformOptions) {
  9. const { nvueCompiler } = platformOptions;
  10. if (nvueCompiler === 'weex') {
  11. return 'weex';
  12. }
  13. if (nvueCompiler === 'vue') {
  14. return 'vue';
  15. }
  16. if (nvueCompiler === 'vite') {
  17. return 'vite';
  18. }
  19. }
  20. return 'uni-app';
  21. }
  22. exports.getNVueCompiler = getNVueCompiler;
  23. function getNVueStyleCompiler(manifestJson) {
  24. const platformOptions = manifestJson['app-plus'];
  25. if (platformOptions && platformOptions.nvueStyleCompiler === 'uni-app') {
  26. return 'uni-app';
  27. }
  28. return 'weex';
  29. }
  30. exports.getNVueStyleCompiler = getNVueStyleCompiler;
  31. const flexDirs = ['row', 'row-reverse', 'column', 'column-reverse'];
  32. function getNVueFlexDirection(manifestJson) {
  33. let flexDir = 'column';
  34. const appPlusJson = manifestJson['app-plus'] || manifestJson['plus'];
  35. if (appPlusJson?.nvue?.['flex-direction'] &&
  36. flexDirs.includes(appPlusJson?.nvue?.['flex-direction'])) {
  37. flexDir = appPlusJson.nvue['flex-direction'];
  38. }
  39. return flexDir;
  40. }
  41. exports.getNVueFlexDirection = getNVueFlexDirection;