Comparing version 2.6.14 to 2.6.15
@@ -29,117 +29,87 @@ "use strict"; | ||
var initRoutes = function initRoutes(routes) { | ||
return new Promise(function (resolve) { | ||
var appRoutes; | ||
var appRoutes; | ||
if (routes && importPages) { | ||
appRoutes = ['/'].concat(routes); | ||
var pagePromises = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return importPages.index(); | ||
} | ||
if (routes && importPages) { | ||
appRoutes = routes.map(function (path, index) { | ||
var _toRoutePath = (0, _utils.toRoutePath)(path), | ||
routePath = _toRoutePath.path, | ||
fileDir = _toRoutePath.fileDir; | ||
var _toRoutePath = (0, _utils.toRoutePath)(path), | ||
fileDir = _toRoutePath.fileDir; | ||
var alias; | ||
return importPages[fileDir](); | ||
}); | ||
Promise.all(pagePromises).then(function (pageComponents) { | ||
appRoutes = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return { | ||
path: '/', | ||
name: 'home', | ||
component: pageComponents[index].default | ||
}; | ||
} | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
var _toRoutePath2 = (0, _utils.toRoutePath)(path), | ||
routePath = _toRoutePath2.path; | ||
var routeObj = { | ||
path: routePath, | ||
asyncComponent: importPages[fileDir] | ||
}; | ||
var alias; | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
return routeObj; | ||
}); | ||
appRoutes = [{ | ||
path: '/', | ||
name: 'home', | ||
async: importPages.index | ||
}].concat(appRoutes); | ||
} | ||
var routeObj = { | ||
path: routePath, | ||
component: pageComponents[index].default | ||
}; | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
return routeObj; | ||
}); | ||
resolve(appRoutes); | ||
}); | ||
} else { | ||
resolve([]); | ||
} | ||
}); | ||
return appRoutes; | ||
}; | ||
var initDevRouter = function initDevRouter(routes) { | ||
return new Promise(function (resolve) { | ||
if (routes) { | ||
var appRoutes = ['/'].concat(routes); | ||
var pagePromises = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return Promise.resolve("/src/" + _constants.PAGE_DIR + "/index.vue").then(function (s) { | ||
return _interopRequireWildcard(require(s)); | ||
}); | ||
} | ||
if (routes) { | ||
// eslint-disable-next-line no-param-reassign | ||
routes = routes.map(function (path, index) { | ||
var _resolvePath = (0, _utils.resolvePath)(path), | ||
_resolvePath$dir = _resolvePath.dir, | ||
dir = _resolvePath$dir === void 0 ? [] : _resolvePath$dir, | ||
fileName = _resolvePath.fileName; | ||
var _resolvePath = (0, _utils.resolvePath)(path), | ||
_resolvePath$dir = _resolvePath.dir, | ||
dir = _resolvePath$dir === void 0 ? [] : _resolvePath$dir, | ||
fileName = _resolvePath.fileName; | ||
var pathToPage = ''; | ||
var pathToPage = ''; | ||
if (dir.length) { | ||
pathToPage = dir.join('/') + "/"; | ||
} | ||
if (dir.length) { | ||
pathToPage = dir.join('/') + "/"; | ||
} | ||
var _toRoutePath2 = (0, _utils.toRoutePath)(path), | ||
routePath = _toRoutePath2.path; | ||
return Promise.resolve("/src/" + _constants.PAGE_DIR + "/" + pathToPage + fileName + ".vue").then(function (s) { | ||
return _interopRequireWildcard(require(s)); | ||
}); | ||
}); | ||
Promise.all(pagePromises).then(function (pageComponents) { | ||
appRoutes = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return { | ||
path: '/', | ||
name: 'home', | ||
component: pageComponents[index].default | ||
}; | ||
} | ||
var alias; | ||
var _toRoutePath3 = (0, _utils.toRoutePath)(path), | ||
routePath = _toRoutePath3.path; | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
var alias; | ||
var routeObj = { | ||
path: routePath, | ||
asyncComponent: function asyncComponent() { | ||
return Promise.resolve("/src/" + _constants.PAGE_DIR + "/" + pathToPage + fileName + ".vue").then(function (s) { | ||
return _interopRequireWildcard(require(s)); | ||
}); | ||
} | ||
}; | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
var routeObj = { | ||
path: routePath, | ||
component: pageComponents[index].default | ||
}; | ||
return routeObj; | ||
}); | ||
routes = [{ | ||
path: '/', | ||
async: function async() { | ||
return Promise.resolve("/src/" + _constants.PAGE_DIR + "/index.vue").then(function (s) { | ||
return _interopRequireWildcard(require(s)); | ||
}); | ||
} | ||
}].concat(routes); | ||
} | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
return routeObj; | ||
}); | ||
resolve(appRoutes); | ||
}); | ||
} else { | ||
resolve([]); | ||
} | ||
}); | ||
return routes; | ||
}; | ||
@@ -146,0 +116,0 @@ |
@@ -19,5 +19,3 @@ "use strict"; | ||
return _ctx.zmpParams.routes ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_App, (0, _vue.mergeProps)({ | ||
key: 0 | ||
}, _ctx.zmpParams), (0, _vue.createSlots)({ | ||
return (0, _vue.openBlock)(), (0, _vue.createBlock)(_component_App, _ctx.zmpParams, (0, _vue.createSlots)({ | ||
_: 2 | ||
@@ -31,3 +29,3 @@ }, [(0, _vue.renderList)(_ctx.$slots, function (_, slot) { | ||
}; | ||
})]), 1040)) : (0, _vue.createCommentVNode)("", true); | ||
})]), 1040); | ||
} | ||
@@ -42,28 +40,19 @@ | ||
props: _app.default.props, | ||
setup: function setup(props, _ref) { | ||
var attrs = _ref.attrs; | ||
var routes = (0, _vue.ref)(); | ||
(0, _vue.onMounted)(function () { | ||
var routesResult = (0, _routerConfig.default)(); | ||
emits: _app.default.emits, | ||
setup: function setup(props) { | ||
var navbar = props.navbar, | ||
routes = props.routes; | ||
if (routesResult) { | ||
routesResult.then(function (configuredRoutes) { | ||
routes.value = configuredRoutes; | ||
}); | ||
} else { | ||
routes.value = props.routes; | ||
} | ||
var navbarConfigs = _extends({}, navbar, { | ||
iosCenterTitle: navbar && navbar.iosCenterTitle || false | ||
}); | ||
var zmpParams = (0, _vue.computed)(function () { | ||
return _extends({}, attrs, props, { | ||
routes: routes.value, | ||
navbar: _extends({}, props.navbar, { | ||
iosCenterTitle: props.navbar && props.navbar.iosCenterTitle || false | ||
}), | ||
var appRoutes = (0, _routerConfig.default)() || routes; | ||
return { | ||
zmpParams: _extends({}, props, { | ||
routes: appRoutes, | ||
navbar: navbarConfigs, | ||
iosTranslucentBars: false, | ||
iosTranslucentModals: false | ||
}); | ||
}); | ||
return { | ||
zmpParams: zmpParams | ||
}) | ||
}; | ||
@@ -70,0 +59,0 @@ } |
/** | ||
* ZMP Vue 2.6.14 | ||
* ZMP Vue 2.6.15 | ||
* Build full featured iOS & Android apps using ZMP & Vue | ||
@@ -4,0 +4,0 @@ * https://h5.zalo.me/vue/ |
/** | ||
* ZMP Vue 2.6.14 | ||
* ZMP Vue 2.6.15 | ||
* Build full featured iOS & Android apps using ZMP & Vue | ||
@@ -4,0 +4,0 @@ * https://h5.zalo.me/vue/ |
@@ -17,117 +17,87 @@ import { getWindow } from 'ssr-window'; | ||
var initRoutes = function initRoutes(routes) { | ||
return new Promise(function (resolve) { | ||
var appRoutes; | ||
var appRoutes; | ||
if (routes && importPages) { | ||
appRoutes = ['/'].concat(routes); | ||
var pagePromises = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return importPages.index(); | ||
} | ||
if (routes && importPages) { | ||
appRoutes = routes.map(function (path, index) { | ||
var _toRoutePath = toRoutePath(path), | ||
routePath = _toRoutePath.path, | ||
fileDir = _toRoutePath.fileDir; | ||
var _toRoutePath = toRoutePath(path), | ||
fileDir = _toRoutePath.fileDir; | ||
var alias; | ||
return importPages[fileDir](); | ||
}); | ||
Promise.all(pagePromises).then(function (pageComponents) { | ||
appRoutes = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return { | ||
path: '/', | ||
name: 'home', | ||
component: pageComponents[index].default | ||
}; | ||
} | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
var _toRoutePath2 = toRoutePath(path), | ||
routePath = _toRoutePath2.path; | ||
var routeObj = { | ||
path: routePath, | ||
asyncComponent: importPages[fileDir] | ||
}; | ||
var alias; | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
return routeObj; | ||
}); | ||
appRoutes = [{ | ||
path: '/', | ||
name: 'home', | ||
async: importPages.index | ||
}].concat(appRoutes); | ||
} | ||
var routeObj = { | ||
path: routePath, | ||
component: pageComponents[index].default | ||
}; | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
return routeObj; | ||
}); | ||
resolve(appRoutes); | ||
}); | ||
} else { | ||
resolve([]); | ||
} | ||
}); | ||
return appRoutes; | ||
}; | ||
var initDevRouter = function initDevRouter(routes) { | ||
return new Promise(function (resolve) { | ||
if (routes) { | ||
var appRoutes = ['/'].concat(routes); | ||
var pagePromises = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return import( | ||
/* @vite-ignore */ | ||
"/src/" + PAGE_DIR + "/index.vue"); | ||
} | ||
if (routes) { | ||
// eslint-disable-next-line no-param-reassign | ||
routes = routes.map(function (path, index) { | ||
var _resolvePath = resolvePath(path), | ||
_resolvePath$dir = _resolvePath.dir, | ||
dir = _resolvePath$dir === void 0 ? [] : _resolvePath$dir, | ||
fileName = _resolvePath.fileName; | ||
var _resolvePath = resolvePath(path), | ||
_resolvePath$dir = _resolvePath.dir, | ||
dir = _resolvePath$dir === void 0 ? [] : _resolvePath$dir, | ||
fileName = _resolvePath.fileName; | ||
var pathToPage = ''; | ||
var pathToPage = ''; | ||
if (dir.length) { | ||
pathToPage = dir.join('/') + "/"; | ||
} | ||
if (dir.length) { | ||
pathToPage = dir.join('/') + "/"; | ||
} | ||
var _toRoutePath2 = toRoutePath(path), | ||
routePath = _toRoutePath2.path; | ||
return import( | ||
/* @vite-ignore */ | ||
"/src/" + PAGE_DIR + "/" + pathToPage + fileName + ".vue"); | ||
}); | ||
Promise.all(pagePromises).then(function (pageComponents) { | ||
appRoutes = appRoutes.map(function (path, index) { | ||
if (index === 0) { | ||
return { | ||
path: '/', | ||
name: 'home', | ||
component: pageComponents[index].default | ||
}; | ||
} | ||
var alias; | ||
var _toRoutePath3 = toRoutePath(path), | ||
routePath = _toRoutePath3.path; | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
var alias; | ||
var routeObj = { | ||
path: routePath, | ||
asyncComponent: function asyncComponent() { | ||
return import( | ||
/* @vite-ignore */ | ||
"/src/" + PAGE_DIR + "/" + pathToPage + fileName + ".vue"); | ||
} | ||
}; | ||
if (routePath) { | ||
alias = routePath.substring(0, routePath.length - 1); | ||
} | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
var routeObj = { | ||
path: routePath, | ||
component: pageComponents[index].default | ||
}; | ||
return routeObj; | ||
}); | ||
routes = [{ | ||
path: '/', | ||
async: function async() { | ||
return import( | ||
/* @vite-ignore */ | ||
"/src/" + PAGE_DIR + "/index.vue"); | ||
} | ||
}].concat(routes); | ||
} | ||
if (alias) { | ||
routeObj.alias = alias; | ||
} | ||
return routeObj; | ||
}); | ||
resolve(appRoutes); | ||
}); | ||
} else { | ||
resolve([]); | ||
} | ||
}); | ||
return routes; | ||
}; | ||
@@ -134,0 +104,0 @@ |
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock, mergeProps as _mergeProps, createCommentVNode as _createCommentVNode } from "vue"; | ||
import { renderSlot as _renderSlot, resolveComponent as _resolveComponent, withCtx as _withCtx, renderList as _renderList, createSlots as _createSlots, openBlock as _openBlock, createBlock as _createBlock } from "vue"; | ||
@@ -8,5 +8,3 @@ function render(_ctx, _cache) { | ||
return _ctx.zmpParams.routes ? (_openBlock(), _createBlock(_component_App, _mergeProps({ | ||
key: 0 | ||
}, _ctx.zmpParams), _createSlots({ | ||
return _openBlock(), _createBlock(_component_App, _ctx.zmpParams, _createSlots({ | ||
_: 2 | ||
@@ -20,6 +18,5 @@ }, [_renderList(_ctx.$slots, function (_, slot) { | ||
}; | ||
})]), 1040)) : _createCommentVNode("", true); | ||
})]), 1040); | ||
} | ||
import { ref, computed, onMounted } from 'vue'; | ||
import App from '../components/app'; | ||
@@ -34,30 +31,21 @@ import routerConfig from '../shared/router-config'; | ||
props: App.props, | ||
setup: function setup(props, _ref) { | ||
var attrs = _ref.attrs; | ||
var routes = ref(); | ||
onMounted(function () { | ||
var routesResult = routerConfig(); | ||
emits: App.emits, | ||
setup: function setup(props) { | ||
var navbar = props.navbar, | ||
routes = props.routes; | ||
if (routesResult) { | ||
routesResult.then(function (configuredRoutes) { | ||
routes.value = configuredRoutes; | ||
}); | ||
} else { | ||
routes.value = props.routes; | ||
} | ||
var navbarConfigs = _extends({}, navbar, { | ||
iosCenterTitle: navbar && navbar.iosCenterTitle || false | ||
}); | ||
var zmpParams = computed(function () { | ||
return _extends({}, attrs, props, { | ||
routes: routes.value, | ||
navbar: _extends({}, props.navbar, { | ||
iosCenterTitle: props.navbar && props.navbar.iosCenterTitle || false | ||
}), | ||
var appRoutes = routerConfig() || routes; | ||
return { | ||
zmpParams: _extends({}, props, { | ||
routes: appRoutes, | ||
navbar: navbarConfigs, | ||
iosTranslucentBars: false, | ||
iosTranslucentModals: false | ||
}); | ||
}); | ||
return { | ||
zmpParams: zmpParams | ||
}) | ||
}; | ||
} | ||
}; |
/** | ||
* ZMP Vue 2.6.14 | ||
* ZMP Vue 2.6.15 | ||
* Build full featured iOS & Android apps using ZMP & Vue | ||
@@ -4,0 +4,0 @@ * https://h5.zalo.me/vue/ |
/** | ||
* ZMP Vue 2.6.14 | ||
* ZMP Vue 2.6.15 | ||
* Build full featured iOS & Android apps using ZMP & Vue | ||
@@ -4,0 +4,0 @@ * https://h5.zalo.me/vue/ |
{ | ||
"name": "zmp-vue", | ||
"version": "2.6.14", | ||
"version": "2.6.15", | ||
"description": "Build full featured iOS & Android apps using ZMP & Vue", | ||
@@ -5,0 +5,0 @@ "main": "cjs/zmp-vue.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1118971
31337