diff --git a/api/creator.js b/api/creator.js index ed336ad..4aa464f 100644 --- a/api/creator.js +++ b/api/creator.js @@ -13,7 +13,7 @@ export function getBannerList() { //获取小程序用户图片列表 export function getUserImgList() { return request({ - url: `${serviceTitle}/img/mini/tiktok/tiktokUserImgs`, + url: `${serviceTitle}/img/mini/tiktok/creatorImgs`, method: 'get' }) } diff --git a/api/index.js b/api/index.js index 2409b06..b589819 100644 --- a/api/index.js +++ b/api/index.js @@ -4,9 +4,9 @@ const serviceTitle = '/img' //POST 传参需要用 data //获取banner列表 -export function tiktokUserImgs() { +export function creatorImgs() { return request({ - url: `${serviceTitle}/img/mini/tiktok/tiktokUserImgs`, + url: `${serviceTitle}/img/mini/tiktok/creatorImgs`, method: 'get' }) } diff --git a/api/myCollection.js b/api/userInfo.js similarity index 85% rename from api/myCollection.js rename to api/userInfo.js index 679a48b..bfcc313 100644 --- a/api/myCollection.js +++ b/api/userInfo.js @@ -4,7 +4,7 @@ const serviceTitle = '/img' //POST 传参需要用 data //获取用户收藏列表 -export function getCollectionList(data) { +export function listTiktokCollection(data) { return request({ url: `${serviceTitle}/img/mini/tiktok/listTiktokCollection`, method: 'post', diff --git a/main.js b/main.js index 932132f..8f9827b 100644 --- a/main.js +++ b/main.js @@ -2,7 +2,8 @@ import App from './App' import store from './store/' // const baseURL = 'http://localhost:7010' -const baseURL = 'http://81.69.47.31:7010' +// const baseURL = 'http://81.69.47.31:7010' +const baseURL = 'http://bnyer.vaiwan.com' Vue.prototype.baseURL = baseURL; diff --git a/pages.json b/pages.json index e661d62..a7a5055 100644 --- a/pages.json +++ b/pages.json @@ -3,7 +3,8 @@ { "path": "pages/index/index", "style": { - "navigationBarTitleText": "首页" + "navigationBarTitleText": "首页", + "enablePullDownRefresh": false } }, { @@ -38,7 +39,7 @@ "path": "pages/userInfo/userInfo", "style": { "navigationBarTitleText": "个人中心", - "enablePullDownRefresh": true + "enablePullDownRefresh": false } }, { "path": "pages/userInfo/myCollection/myCollection", diff --git a/pages/creator/creator.vue b/pages/creator/creator.vue index 1092dd5..8e5723a 100644 --- a/pages/creator/creator.vue +++ b/pages/creator/creator.vue @@ -12,8 +12,8 @@ - - + + @@ -69,6 +69,12 @@ this.getBanner(); this.getUserImgList(); }, + // 下拉刷新 + onPullDownRefresh(){ + this.getBanner(); + this.getUserImgList(); + uni.stopPullDownRefresh() + }, methods: { // 跳转用户详情页 toUserDetail(item){ @@ -77,7 +83,7 @@ key: 'userDetail', data: item, success() { - uni.redirectTo({ + uni.navigateTo({ url: '../creator/userDetail' }) } @@ -93,7 +99,7 @@ data: item.id, success() { console.log(111111) - uni.redirectTo({ + uni.navigateTo({ url: '../creator/imgDetail' }) } diff --git a/pages/creator/imgDetail.vue b/pages/creator/imgDetail.vue index 8225b51..e266191 100644 --- a/pages/creator/imgDetail.vue +++ b/pages/creator/imgDetail.vue @@ -9,20 +9,23 @@ - 下载{{detailMsg.downloadNum}} + 下载 - 喜欢{{detailMsg.greatNum}} + 喜欢 - 收藏{{detailMsg.collectionNum}} + 收藏 - - + @@ -49,12 +52,21 @@ } }, created() { - uni.getStorage({ - key: 'detailId', - success: res => { - this.getImgDetail(res.data) - } - }) + const detailId = uni.getStorageSync('detailId') + if (detailId) { + this.getImgDetail(detailId) + } else { + this.getImgDetail(detailId) + } + }, + onShareAppMessage(res) { + if (res.from === 'button') { // 来自页面内分享按钮 + console.log(res) + } + return { + title: '自定义分享标题', + path: `/pages/creator/imgDetail?id=${this.userInfo.id}` + } }, methods: { // 图片详情 @@ -75,7 +87,7 @@ } else { uni.showToast({ title: '请输入艺术家代号', - icon: 'error' + icon: 'none' }) } }, @@ -92,7 +104,7 @@ } else { uni.showToast({ title: res.data.msg, - icon: 'error' + icon: 'none' }) } }, @@ -108,7 +120,7 @@ } else { uni.showToast({ title: res.data.msg, - icon: 'error' + icon: 'none' }) } }, @@ -125,24 +137,20 @@ //点赞 console.log('点赞') const res = await tiktokLike(params) - if (res.data.code === 200) { - this.detailMsg.greatNum += 1 - } else { + if (res.data.code === 200) {} else { uni.showToast({ title: res.data.msg, - icon: 'error' + icon: 'none' }) } } else { //取消点赞 console.log('取消点赞') const res = await tiktokUnLike(params) - if (res.data.code === 200) { - this.detailMsg.greatNum -= 1 - } else { + if (res.data.code === 200) {} else { uni.showToast({ title: res.data.msg, - icon: 'error' + icon: 'none' }) } } @@ -152,24 +160,20 @@ //收藏 console.log('收藏') const res = await tiktokCollect(params) - if (res.data.code === 200) { - this.detailMsg.collectionNum += 1 - } else { + if (res.data.code === 200) {} else { uni.showToast({ title: res.data.msg, - icon: 'error' + icon: 'none' }) } } else { //取消收藏 console.log('取消收藏') const res = await tiktokUnCollect(params) - if (res.data.code === 200) { - this.detailMsg.collectionNum -= 1 - } else { + if (res.data.code === 200) {} else { uni.showToast({ title: res.data.msg, - icon: 'error' + icon: 'none' }) } } @@ -180,7 +184,6 @@ // 下载 download(url) { this.isDownload = true - this.detailMsg.downloadNum += 1 uni.showLoading({ title: '正在保存图片...' }); @@ -215,21 +218,24 @@ .showToast({ title: res .errMsg, + icon: 'none' }); }, complete: (res) => { uni.hideLoading(); if (res.errMsg !== "saveImageToPhotosAlbum:ok" - ) { + ) { return uni .showToast({ title: "下载失败!", + icon: 'none' }); } else { return uni .showToast({ title: "下载成功!", + icon: 'none' }); } }, @@ -237,9 +243,9 @@ } else { uni.showToast({ title: "下载失败!", + icon: 'none' }); } - } }) }, @@ -265,6 +271,7 @@ } else if (res.cancel) { return uni.showToast({ title: "已取消!", + icon: 'none' }); } }, @@ -279,6 +286,7 @@ uni.hideLoading(); return uni.showToast({ title: "保存成功!", + icon: 'none' }); }, fail: (res) => { @@ -286,6 +294,7 @@ console.log(res.errMsg); return uni.showToast({ title: res.errMsg, + icon: 'none' }); }, //无论成功失败都走的回调 @@ -302,8 +311,9 @@ share() { uni.showToast({ title: '分享', + icon: 'none' }) - } + }, } } @@ -322,14 +332,25 @@ .toolbar { width: 60px; - height: 360px; background-color: rgba(255, 255, 255, 0.2); position: absolute; bottom: 76px; right: 10px; border-radius: 60px; padding-top: 40rpx; - + .share-box{ + outline: none; + background: none; + border: none; + >button{ + line-height: auto!important; + padding: 0; + + } + >button ::after{ + border: none; + } + } .toolbar-box { height: 60px; text-align: center; @@ -353,6 +374,7 @@ line-height: 40rpx; height: 40rpx; } + } } diff --git a/pages/index/choiceness.vue b/pages/index/choiceness.vue index 3f8725a..35af060 100644 --- a/pages/index/choiceness.vue +++ b/pages/index/choiceness.vue @@ -4,17 +4,16 @@ @confirm="search" /> - + + + - - - - @@ -26,10 +25,11 @@ export default { data() { return { - imgList1: [], //图片列表 - imgList2: [], //图片列表 + imgList: [], //图片列表 imgWidth: 0, // 图片宽 imgHeight: 0, // 图片高 + pageNum: 1, + pageSize: 10, } }, created() { @@ -42,22 +42,36 @@ } }) }, + // 下拉刷新 + onPullDownRefresh(){ + console.log(1111) + this.pageNum = 1 + this.imgList = [] + this.getImgList() + uni.stopPullDownRefresh() + }, + // 上划加载更多 + onReachBottom() { + if (this.imgList.length > 9) { + this.pageNum += 1 + this.getImgList() + } + }, methods: { - // 图片列表分类实现瀑布流 + // 图片列表 async getImgList() { - const res = await imgLists() + const res = await imgLists({ + pageNum: this.pageNum, + pageSize: this.pageSize + }) if (res.data.code === 200) { for (let i = 0; i < res.data.rows.length; i++) { - if (i % 2 == 0) { - this.imgList2.push(res.data.rows[i]) - } else { - this.imgList1.push(res.data.rows[i]) - } + this.imgList.push(res.data.rows[i]) } } else { uni.showToast({ title: res.data.msg, - icon: 'error' + icon: 'none' }) } }, @@ -76,6 +90,15 @@ } }) } + }, + onload(e) { + console.log("onload"); + }, + onclose(e) { + console.log("onclose: " + e.detail); + }, + onerror(e) { + console.log("onerror: " + e.detail.errCode + " message:: " + e.detail.errMsg); } }, // onUnload() { @@ -95,6 +118,7 @@ border: 1px solid #11A8FD; border-radius: 16rpx; padding: 0; + margin-left: 40rpx; .uni-searchbar__box { padding: 0; diff --git a/pages/index/index.vue b/pages/index/index.vue index f9eb92f..f68b804 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -13,14 +13,6 @@ {{item.tiktokNumber}} - - - {{item.tiktokNumber}} - - - - {{item.tiktokNumber}} - @@ -32,14 +24,15 @@ - diff --git a/pages/userInfo/userInfo.vue b/pages/userInfo/userInfo.vue index 6fbabf9..8b2ad80 100644 --- a/pages/userInfo/userInfo.vue +++ b/pages/userInfo/userInfo.vue @@ -1,14 +1,25 @@ @@ -16,34 +27,26 @@ export default { data() { return { - + userInfo: {} + } + }, + created() { + this.userInfo = uni.getStorageSync('userInfo') + }, + onShareAppMessage(res) { + if (res.from === 'button') { // 来自页面内分享按钮 + console.log(res) + } + return { + title: '自定义分享标题', + path: `/pages/index/index?id=${this.userInfo.id}` } }, methods: { - getLink(){ - // uni.showModal({ - // content: '啦啦啦分享啦', - // showCancel: false - // }); - uni.login({ - // provider: 'toutiao', - success: function (info) { - console.log('code为:'+JSON.stringify(info.code)); - // 获取用户信息 - uni.getUserInfo({ - // provider: 'toutiao', - withCredentials: true, - success: function (infoRes) { - //console.log('信息为:'+JSON.stringify(infoRes)) - console.log('encry数据为:'+infoRes.encryptedData); - console.log('iv数据为:'+infoRes.iv); - //console.log('用户昵称为:' + infoRes.userInfo.nickName); - } - }); - } - }); + share() { + }, - getPhoneNumber(e){ + getPhoneNumber(e) { console.log(e.detail.errMsg); console.log(e.detail.iv); console.log(e.detail.encryptedData); @@ -52,6 +55,54 @@ } - diff --git a/unpackage/dist/dev/mp-toutiao/common/main.js b/unpackage/dist/dev/mp-toutiao/common/main.js index 8989b21..3197544 100644 --- a/unpackage/dist/dev/mp-toutiao/common/main.js +++ b/unpackage/dist/dev/mp-toutiao/common/main.js @@ -16,9 +16,10 @@ var _store = _interopRequireDefault(__webpack_require__(/*! ./store/ */ 12)); -var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__; // const baseURL = 'http://localhost:7010' -var baseURL = 'http://81.69.47.31:7010';_vue.default.prototype.baseURL = baseURL;_vue.default.config.productionTip = false; -_App.default.mpType = 'app'; + +var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}wx.__webpack_require_UNI_MP_PLUGIN__ = __webpack_require__; // const baseURL = 'http://localhost:7010' +// const baseURL = 'http://81.69.47.31:7010' +var baseURL = 'http://bnyer.vaiwan.com';_vue.default.prototype.baseURL = baseURL;_vue.default.config.productionTip = false;_App.default.mpType = 'app'; var app = new _vue.default(_objectSpread({}, _App.default)); @@ -135,4 +136,4 @@ __webpack_require__.r(__webpack_exports__); /***/ }) ],[[0,"common/runtime","common/vendor"]]]); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInVuaS1hcHA6Ly8vbWFpbi5qcyIsbnVsbCwid2VicGFjazovLy9FOi/lvIDlj5EvYm55ZXItY2xvdWQtdGlrdG9rL0FwcC52dWU/NzVjNCIsInVuaS1hcHA6Ly8vQXBwLnZ1ZSIsIndlYnBhY2s6Ly8vRTov5byA5Y+RL2JueWVyLWNsb3VkLXRpa3Rvay9BcHAudnVlP2M1NmIiLCJ3ZWJwYWNrOi8vL0U6L+W8gOWPkS9ibnllci1jbG91ZC10aWt0b2svQXBwLnZ1ZT81ZGU4Il0sIm5hbWVzIjpbInd4IiwiX193ZWJwYWNrX3JlcXVpcmVfVU5JX01QX1BMVUdJTl9fIiwiX193ZWJwYWNrX3JlcXVpcmVfXyIsImJhc2VVUkwiLCJWdWUiLCJwcm90b3R5cGUiLCJjb25maWciLCJwcm9kdWN0aW9uVGlwIiwiQXBwIiwibXBUeXBlIiwiYXBwIiwiJG1vdW50Il0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7cURBQUEsd0NBQThFO0FBQzlFOzs7Ozs7OztBQVFBLHFFLHduQ0FUbUJBLEVBQUUsQ0FBQ0MsaUNBQUgsR0FBdUNDLG1CQUF2QyxDLENBR25CO0FBQ0EsSUFBTUMsT0FBTyxHQUFHLHlCQUFoQixDQUVBQyxhQUFJQyxTQUFKLENBQWNGLE9BQWQsR0FBd0JBLE9BQXhCLENBSUFDLGFBQ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xwbHVnaW5zXFxcXHVuaWFwcC1jbGlcXFxcbm9kZV9tb2R1bGVzXFxcXEBkY2xvdWRpb1xcXFx3ZWJwYWNrLXVuaS1tcC1sb2FkZXJcXFxcbGliXFxcXHN0eWxlLmpzIS4vQXBwLnZ1ZT92dWUmdHlwZT1zdHlsZSZpbmRleD0wJmxhbmc9c2NzcyZcIiIsIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpblxuICAgIGlmKG1vZHVsZS5ob3QpIHtcbiAgICAgIC8vIDE2NTU2MzYzMTQzMTlcbiAgICAgIHZhciBjc3NSZWxvYWQgPSByZXF1aXJlKFwiRDovSEJ1aWxkZXJYL3BsdWdpbnMvdW5pYXBwLWNsaS9ub2RlX21vZHVsZXMvbWluaS1jc3MtZXh0cmFjdC1wbHVnaW4vZGlzdC9obXIvaG90TW9kdWxlUmVwbGFjZW1lbnQuanNcIikobW9kdWxlLmlkLCB7XCJobXJcIjp0cnVlLFwicHVibGljUGF0aFwiOlwiLi4vLi4vXCIsXCJsb2NhbHNcIjpmYWxzZX0pO1xuICAgICAgbW9kdWxlLmhvdC5kaXNwb3NlKGNzc1JlbG9hZCk7XG4gICAgICBtb2R1bGUuaG90LmFjY2VwdCh1bmRlZmluZWQsIGNzc1JlbG9hZCk7XG4gICAgfVxuICAiXSwic291cmNlUm9vdCI6IiJ9 \ No newline at end of file diff --git a/unpackage/dist/dev/mp-toutiao/common/vendor.js b/unpackage/dist/dev/mp-toutiao/common/vendor.js index f40bff3..d0ed0da 100644 --- a/unpackage/dist/dev/mp-toutiao/common/vendor.js +++ b/unpackage/dist/dev/mp-toutiao/common/vendor.js @@ -8,8 +8,8 @@ /***/ (function(module, exports, __webpack_require__) { "use strict"; -/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 3)); -var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 4);function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;} +/* WEBPACK VAR INJECTION */(function(global) {Object.defineProperty(exports, "__esModule", { value: true });exports.createApp = createApp;exports.createComponent = createComponent;exports.createPage = createPage;exports.createPlugin = createPlugin;exports.createSubpackageApp = createSubpackageApp;exports.default = void 0;var _uniI18n = __webpack_require__(/*! @dcloudio/uni-i18n */ 3); +var _vue = _interopRequireDefault(__webpack_require__(/*! vue */ 4));function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}function ownKeys(object, enumerableOnly) {var keys = Object.keys(object);if (Object.getOwnPropertySymbols) {var symbols = Object.getOwnPropertySymbols(object);if (enumerableOnly) symbols = symbols.filter(function (sym) {return Object.getOwnPropertyDescriptor(object, sym).enumerable;});keys.push.apply(keys, symbols);}return keys;}function _objectSpread(target) {for (var i = 1; i < arguments.length; i++) {var source = arguments[i] != null ? arguments[i] : {};if (i % 2) {ownKeys(Object(source), true).forEach(function (key) {_defineProperty(target, key, source[key]);});} else if (Object.getOwnPropertyDescriptors) {Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));} else {ownKeys(Object(source)).forEach(function (key) {Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));});}}return target;}function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _defineProperty(obj, key, value) {if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}function _toConsumableArray(arr) {return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();}function _nonIterableSpread() {throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _iterableToArray(iter) {if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);}function _arrayWithoutHoles(arr) {if (Array.isArray(arr)) return _arrayLikeToArray(arr);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;} var realAtob; @@ -324,7 +324,7 @@ var promiseInterceptor = { var SYNC_API_RE = -/^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale/; +/^\$|Window$|WindowStyle$|sendHostEvent|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getLocale|setLocale|invokePushCallback|getWindowInfo|getDeviceInfo|getAppBaseInfo/; var CONTEXT_API_RE = /^create|Manager$/; @@ -437,7 +437,134 @@ function upx2px(number, newDeviceWidth) { return number < 0 ? -result : result; } -function getLocale() { +var LOCALE_ZH_HANS = 'zh-Hans'; +var LOCALE_ZH_HANT = 'zh-Hant'; +var LOCALE_EN = 'en'; +var LOCALE_FR = 'fr'; +var LOCALE_ES = 'es'; + +var messages = {}; + +var locale; + +{ + locale = normalizeLocale(tt.getSystemInfoSync().language) || LOCALE_EN; +} + +function initI18nMessages() { + if (!isEnableLocale()) { + return; + } + var localeKeys = Object.keys(__uniConfig.locales); + if (localeKeys.length) { + localeKeys.forEach(function (locale) { + var curMessages = messages[locale]; + var userMessages = __uniConfig.locales[locale]; + if (curMessages) { + Object.assign(curMessages, userMessages); + } else { + messages[locale] = userMessages; + } + }); + } +} + +initI18nMessages(); + +var i18n = (0, _uniI18n.initVueI18n)( +locale, +{}); + +var t = i18n.t; +var i18nMixin = i18n.mixin = { + beforeCreate: function beforeCreate() {var _this = this; + var unwatch = i18n.i18n.watchLocale(function () { + _this.$forceUpdate(); + }); + this.$once('hook:beforeDestroy', function () { + unwatch(); + }); + }, + methods: { + $$t: function $$t(key, values) { + return t(key, values); + } } }; + + +var setLocale = i18n.setLocale; +var getLocale = i18n.getLocale; + +function initAppLocale(Vue, appVm, locale) { + var state = Vue.observable({ + locale: locale || i18n.getLocale() }); + + var localeWatchers = []; + appVm.$watchLocale = function (fn) { + localeWatchers.push(fn); + }; + Object.defineProperty(appVm, '$locale', { + get: function get() { + return state.locale; + }, + set: function set(v) { + state.locale = v; + localeWatchers.forEach(function (watch) {return watch(v);}); + } }); + +} + +function isEnableLocale() { + return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length; +} + +function include(str, parts) { + return !!parts.find(function (part) {return str.indexOf(part) !== -1;}); +} + +function startsWith(str, parts) { + return parts.find(function (part) {return str.indexOf(part) === 0;}); +} + +function normalizeLocale(locale, messages) { + if (!locale) { + return; + } + locale = locale.trim().replace(/_/g, '-'); + if (messages && messages[locale]) { + return locale; + } + locale = locale.toLowerCase(); + if (locale === 'chinese') { + // 支付宝 + return LOCALE_ZH_HANS; + } + if (locale.indexOf('zh') === 0) { + if (locale.indexOf('-hans') > -1) { + return LOCALE_ZH_HANS; + } + if (locale.indexOf('-hant') > -1) { + return LOCALE_ZH_HANT; + } + if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) { + return LOCALE_ZH_HANT; + } + return LOCALE_ZH_HANS; + } + var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]); + if (lang) { + return lang; + } +} +// export function initI18n() { +// const localeKeys = Object.keys(__uniConfig.locales || {}) +// if (localeKeys.length) { +// localeKeys.forEach((locale) => +// i18n.add(locale, __uniConfig.locales[locale]) +// ) +// } +// } + +function getLocale$1() { // 优先使用 $locale var app = getApp({ allowDefault: true }); @@ -445,10 +572,10 @@ function getLocale() { if (app && app.$vm) { return app.$vm.$locale; } - return tt.getSystemInfoSync().language || 'zh-Hans'; + return normalizeLocale(tt.getSystemInfoSync().language) || LOCALE_EN; } -function setLocale(locale) { +function setLocale$1(locale) { var app = getApp(); if (!app) { return false; @@ -472,7 +599,7 @@ function onLocaleChange(fn) { } if (typeof global !== 'undefined') { - global.getLocale = getLocale; + global.getLocale = getLocale$1; } var interceptors = { @@ -482,8 +609,8 @@ var interceptors = { var baseApi = /*#__PURE__*/Object.freeze({ __proto__: null, upx2px: upx2px, - getLocale: getLocale, - setLocale: setLocale, + getLocale: getLocale$1, + setLocale: setLocale$1, onLocaleChange: onLocaleChange, addInterceptor: addInterceptor, removeInterceptor: removeInterceptor, @@ -491,13 +618,13 @@ var baseApi = /*#__PURE__*/Object.freeze({ EventChannel = /*#__PURE__*/function () { - function EventChannel(id, events) {var _this = this;_classCallCheck(this, EventChannel); + function EventChannel(id, events) {var _this2 = this;_classCallCheck(this, EventChannel); this.id = id; this.listener = {}; this.emitCache = {}; if (events) { Object.keys(events).forEach(function (name) { - _this.on(name, events[name]); + _this2.on(name, events[name]); }); } }_createClass(EventChannel, [{ key: "emit", value: function emit( @@ -663,7 +790,7 @@ var previewImage = { var UUID_KEY = '__DC_STAT_UUID'; var deviceId; -function addUuid(result) { +function useDeviceId(result) { deviceId = deviceId || tt.getStorageSync(UUID_KEY); if (!deviceId) { deviceId = Date.now() + '' + Math.floor(Math.random() * 1e7); @@ -682,15 +809,136 @@ function addSafeAreaInsets(result) { top: safeArea.top, left: safeArea.left, right: result.windowWidth - safeArea.right, - bottom: result.windowHeight - safeArea.bottom }; + bottom: result.screenHeight - safeArea.bottom }; + + } +} + +function populateParameters(result) {var _result$brand = + + + + + + result.brand,brand = _result$brand === void 0 ? '' : _result$brand,_result$model = result.model,model = _result$model === void 0 ? '' : _result$model,_result$system = result.system,system = _result$system === void 0 ? '' : _result$system,_result$language = result.language,language = _result$language === void 0 ? '' : _result$language,theme = result.theme,version = result.version,platform = result.platform,fontSizeSetting = result.fontSizeSetting,SDKVersion = result.SDKVersion,pixelRatio = result.pixelRatio,deviceOrientation = result.deviceOrientation; + // const isQuickApp = "mp-toutiao".indexOf('quickapp-webview') !== -1 + + // osName osVersion + var osName = ''; + var osVersion = ''; + { + osName = system.split(' ')[0] || ''; + osVersion = system.split(' ')[1] || ''; + } + var hostVersion = version; + + // deviceType + var deviceType = getGetDeviceType(result, model); + + // deviceModel + var deviceBrand = getDeviceBrand(brand); + + // hostName + var _hostName = getHostName(result); + + // deviceOrientation + var _deviceOrientation = deviceOrientation; // 仅 微信 百度 支持 + + // devicePixelRatio + var _devicePixelRatio = pixelRatio; + + // SDKVersion + var _SDKVersion = SDKVersion; + + // hostLanguage + var hostLanguage = language.replace(/_/g, '-'); + + // wx.getAccountInfoSync + + var parameters = { + appId: "", + appName: "app", + appVersion: "1.0.0", + appVersionCode: "100", + appLanguage: getAppLanguage(hostLanguage), + uniCompileVersion: "3.4.15", + uniRuntimeVersion: "3.4.15", + uniPlatform: undefined || "mp-toutiao", + deviceBrand: deviceBrand, + deviceModel: model, + deviceType: deviceType, + devicePixelRatio: _devicePixelRatio, + deviceOrientation: _deviceOrientation, + osName: osName.toLocaleLowerCase(), + osVersion: osVersion, + hostTheme: theme, + hostVersion: hostVersion, + hostLanguage: hostLanguage, + hostName: _hostName, + hostSDKVersion: _SDKVersion, + hostFontSizeSetting: fontSizeSetting, + windowTop: 0, + windowBottom: 0, + // TODO + osLanguage: undefined, + osTheme: undefined, + ua: undefined, + hostPackageName: undefined, + browserName: undefined, + browserVersion: undefined }; + + + Object.assign(result, parameters); +} + +function getGetDeviceType(result, model) { + var deviceType = result.deviceType || 'phone'; + { + var deviceTypeMaps = { + ipad: 'pad', + windows: 'pc', + mac: 'pc' }; + + var deviceTypeMapsKeys = Object.keys(deviceTypeMaps); + var _model = model.toLocaleLowerCase(); + for (var index = 0; index < deviceTypeMapsKeys.length; index++) { + var _m = deviceTypeMapsKeys[index]; + if (_model.indexOf(_m) !== -1) { + deviceType = deviceTypeMaps[_m]; + break; + } + } + } + return deviceType; +} +function getDeviceBrand(brand) { + var deviceBrand = brand; + if (deviceBrand) { + deviceBrand = brand.toLocaleLowerCase(); } + return deviceBrand; +} + +function getAppLanguage(defaultLanguage) { + return getLocale$1 ? + getLocale$1() : + defaultLanguage; +} + +function getHostName(result) { + var _platform = "mp-toutiao".split('-')[1]; + var _hostName = result.hostName || _platform; // mp-jd + {_hostName = result.appName;} + + return _hostName; } var getSystemInfo = { returnValue: function returnValue(result) { - addUuid(result); + useDeviceId(result); addSafeAreaInsets(result); + populateParameters(result); } }; @@ -1150,9 +1398,137 @@ function createMediaQueryObserver() { return mediaQueryObserver; } +/** + * 框架内 try-catch + */ +/** + * 开发者 try-catch + */ +function tryCatch(fn) { + return function () { + try { + return fn.apply(fn, arguments); + } catch (e) { + // TODO + console.error(e); + } + }; +} + +function getApiCallbacks(params) { + var apiCallbacks = {}; + for (var name in params) { + var param = params[name]; + if (isFn(param)) { + apiCallbacks[name] = tryCatch(param); + delete params[name]; + } + } + return apiCallbacks; +} + +var cid; +var cidErrMsg; + +function normalizePushMessage(message) { + try { + return JSON.parse(message); + } catch (e) {} + return message; +} + +function invokePushCallback( +args) +{ + if (args.type === 'clientId') { + cid = args.cid; + cidErrMsg = args.errMsg; + invokeGetPushCidCallbacks(cid, args.errMsg); + } else if (args.type === 'pushMsg') { + onPushMessageCallbacks.forEach(function (callback) { + callback({ + type: 'receive', + data: normalizePushMessage(args.message) }); + + }); + } else if (args.type === 'click') { + onPushMessageCallbacks.forEach(function (callback) { + callback({ + type: 'click', + data: normalizePushMessage(args.message) }); + + }); + } +} + +var getPushCidCallbacks = []; + +function invokeGetPushCidCallbacks(cid, errMsg) { + getPushCidCallbacks.forEach(function (callback) { + callback(cid, errMsg); + }); + getPushCidCallbacks.length = 0; +} + +function getPushClientid(args) { + if (!isPlainObject(args)) { + args = {}; + }var _getApiCallbacks = + + + + + getApiCallbacks(args),success = _getApiCallbacks.success,fail = _getApiCallbacks.fail,complete = _getApiCallbacks.complete; + var hasSuccess = isFn(success); + var hasFail = isFn(fail); + var hasComplete = isFn(complete); + getPushCidCallbacks.push(function (cid, errMsg) { + var res; + if (cid) { + res = { + errMsg: 'getPushClientid:ok', + cid: cid }; + + hasSuccess && success(res); + } else { + res = { + errMsg: 'getPushClientid:fail' + (errMsg ? ' ' + errMsg : '') }; + + hasFail && fail(res); + } + hasComplete && complete(res); + }); + if (typeof cid !== 'undefined') { + Promise.resolve().then(function () {return invokeGetPushCidCallbacks(cid, cidErrMsg);}); + } +} + +var onPushMessageCallbacks = []; +// 不使用 defineOnApi 实现,是因为 defineOnApi 依赖 UniServiceJSBridge ,该对象目前在小程序上未提供,故简单实现 +var onPushMessage = function onPushMessage(fn) { + if (onPushMessageCallbacks.indexOf(fn) === -1) { + onPushMessageCallbacks.push(fn); + } +}; + +var offPushMessage = function offPushMessage(fn) { + if (!fn) { + onPushMessageCallbacks.length = 0; + } else { + var index = onPushMessageCallbacks.indexOf(fn); + if (index > -1) { + onPushMessageCallbacks.splice(index, 1); + } + } +}; + var api = /*#__PURE__*/Object.freeze({ __proto__: null, - createMediaQueryObserver: createMediaQueryObserver }); + createMediaQueryObserver: createMediaQueryObserver, + getPushClientid: getPushClientid, + onPushMessage: onPushMessage, + offPushMessage: offPushMessage, + invokePushCallback: invokePushCallback }); var MPPage = Page; @@ -1665,7 +2041,7 @@ function getContextVm(vm) { return $parent && $parent.$parent; } -function handleEvent(event) {var _this2 = this; +function handleEvent(event) {var _this3 = this; event = wrapper$1(event); // [['tap',[['handle',[1,2,a]],['handle1',[1,2,a]]]]] @@ -1696,14 +2072,14 @@ function handleEvent(event) {var _this2 = this; eventsArray.forEach(function (eventArray) { var methodName = eventArray[0]; if (methodName) { - var handlerCtx = _this2.$vm; + var handlerCtx = _this3.$vm; if (handlerCtx.$options.generic) {// mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = getContextVm(handlerCtx) || handlerCtx; } if (methodName === '$emit') { handlerCtx.$emit.apply(handlerCtx, processEventArgs( - _this2.$vm, + _this3.$vm, event, eventArray[1], eventArray[2], @@ -1723,7 +2099,7 @@ function handleEvent(event) {var _this2 = this; handler.once = true; } var params = processEventArgs( - _this2.$vm, + _this3.$vm, event, eventArray[1], eventArray[2], @@ -1751,129 +2127,46 @@ function handleEvent(event) {var _this2 = this; } } -var messages = {}; - -var locale; +var hooks = [ +'onShow', +'onHide', +'onError', +'onPageNotFound', +'onThemeChange', +'onUnhandledRejection']; -{ - locale = tt.getSystemInfoSync().language; -} -function initI18nMessages() { - if (!isEnableLocale()) { - return; - } - var localeKeys = Object.keys(__uniConfig.locales); - if (localeKeys.length) { - localeKeys.forEach(function (locale) { - var curMessages = messages[locale]; - var userMessages = __uniConfig.locales[locale]; - if (curMessages) { - Object.assign(curMessages, userMessages); - } else { - messages[locale] = userMessages; - } - }); - } +function initEventChannel$1() { + _vue.default.prototype.getOpenerEventChannel = function () { + if (!this.__eventChannel__) { + this.__eventChannel__ = new EventChannel(); + } + return this.__eventChannel__; + }; + var callHook = _vue.default.prototype.__call_hook; + _vue.default.prototype.__call_hook = function (hook, args) { + if (hook === 'onLoad' && args && args.__id__) { + this.__eventChannel__ = getEventChannel(args.__id__); + delete args.__id__; + } + return callHook.call(this, hook, args); + }; } -initI18nMessages(); +function initScopedSlotsParams() { + var center = {}; + var parents = {}; -var i18n = (0, _uniI18n.initVueI18n)( -locale, -{}); - -var t = i18n.t; -var i18nMixin = i18n.mixin = { - beforeCreate: function beforeCreate() {var _this3 = this; - var unwatch = i18n.i18n.watchLocale(function () { - _this3.$forceUpdate(); - }); - this.$once('hook:beforeDestroy', function () { - unwatch(); - }); - }, - methods: { - $$t: function $$t(key, values) { - return t(key, values); - } } }; - - -var setLocale$1 = i18n.setLocale; -var getLocale$1 = i18n.getLocale; - -function initAppLocale(Vue, appVm, locale) { - var state = Vue.observable({ - locale: locale || i18n.getLocale() }); - - var localeWatchers = []; - appVm.$watchLocale = function (fn) { - localeWatchers.push(fn); - }; - Object.defineProperty(appVm, '$locale', { - get: function get() { - return state.locale; - }, - set: function set(v) { - state.locale = v; - localeWatchers.forEach(function (watch) {return watch(v);}); - } }); - -} - -function isEnableLocale() { - return typeof __uniConfig !== 'undefined' && __uniConfig.locales && !!Object.keys(__uniConfig.locales).length; -} - -// export function initI18n() { -// const localeKeys = Object.keys(__uniConfig.locales || {}) -// if (localeKeys.length) { -// localeKeys.forEach((locale) => -// i18n.add(locale, __uniConfig.locales[locale]) -// ) -// } -// } - -var hooks = [ -'onShow', -'onHide', -'onError', -'onPageNotFound', -'onThemeChange', -'onUnhandledRejection']; - - -function initEventChannel$1() { - _vue.default.prototype.getOpenerEventChannel = function () { - if (!this.__eventChannel__) { - this.__eventChannel__ = new EventChannel(); - } - return this.__eventChannel__; - }; - var callHook = _vue.default.prototype.__call_hook; - _vue.default.prototype.__call_hook = function (hook, args) { - if (hook === 'onLoad' && args && args.__id__) { - this.__eventChannel__ = getEventChannel(args.__id__); - delete args.__id__; - } - return callHook.call(this, hook, args); - }; -} - -function initScopedSlotsParams() { - var center = {}; - var parents = {}; - - _vue.default.prototype.$hasScopedSlotsParams = function (vueId) { - var has = center[vueId]; - if (!has) { - parents[vueId] = this; - this.$on('hook:destroyed', function () { - delete parents[vueId]; - }); - } - return has; - }; + _vue.default.prototype.$hasScopedSlotsParams = function (vueId) { + var has = center[vueId]; + if (!has) { + parents[vueId] = this; + this.$on('hook:destroyed', function () { + delete parents[vueId]; + }); + } + return has; + }; _vue.default.prototype.$getScopedSlotsParams = function (vueId, name, key) { var data = center[vueId]; @@ -1990,7 +2283,7 @@ function parseBaseApp(vm, _ref3) }); } - initAppLocale(_vue.default, vm, tt.getSystemInfoSync().language || 'zh-Hans'); + initAppLocale(_vue.default, vm, normalizeLocale(tt.getSystemInfoSync().language) || LOCALE_EN); initHooks(appOptions, hooks); @@ -2610,6515 +2903,6515 @@ module.exports = g; /***/ }), /* 3 */ -/*!******************************************************************************************!*\ - !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***! - \******************************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*!*************************************************************!*\ + !*** ./node_modules/@dcloudio/uni-i18n/dist/uni-i18n.es.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -__webpack_require__.r(__webpack_exports__); -/* WEBPACK VAR INJECTION */(function(global) {/*! - * Vue.js v2.6.11 - * (c) 2014-2022 Evan You - * Released under the MIT License. - */ -/* */ - -var emptyObject = Object.freeze({}); - -// These helpers produce better VM code in JS engines due to their -// explicitness and function inlining. -function isUndef (v) { - return v === undefined || v === null -} - -function isDef (v) { - return v !== undefined && v !== null -} - -function isTrue (v) { - return v === true -} +/* WEBPACK VAR INJECTION */(function(uni, global) {Object.defineProperty(exports, "__esModule", { value: true });exports.compileI18nJsonStr = compileI18nJsonStr;exports.hasI18nJson = hasI18nJson;exports.initVueI18n = initVueI18n;exports.isI18nStr = isI18nStr;exports.normalizeLocale = normalizeLocale;exports.parseI18nJson = parseI18nJson;exports.resolveLocale = resolveLocale;exports.isString = exports.LOCALE_ZH_HANT = exports.LOCALE_ZH_HANS = exports.LOCALE_FR = exports.LOCALE_ES = exports.LOCALE_EN = exports.I18n = exports.Formatter = void 0;function _slicedToArray(arr, i) {return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();}function _nonIterableRest() {throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _unsupportedIterableToArray(o, minLen) {if (!o) return;if (typeof o === "string") return _arrayLikeToArray(o, minLen);var n = Object.prototype.toString.call(o).slice(8, -1);if (n === "Object" && o.constructor) n = o.constructor.name;if (n === "Map" || n === "Set") return Array.from(o);if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);}function _arrayLikeToArray(arr, len) {if (len == null || len > arr.length) len = arr.length;for (var i = 0, arr2 = new Array(len); i < len; i++) {arr2[i] = arr[i];}return arr2;}function _iterableToArrayLimit(arr, i) {if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"] != null) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}function _arrayWithHoles(arr) {if (Array.isArray(arr)) return arr;}function _classCallCheck(instance, Constructor) {if (!(instance instanceof Constructor)) {throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target, props) {for (var i = 0; i < props.length; i++) {var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ("value" in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor);}}function _createClass(Constructor, protoProps, staticProps) {if (protoProps) _defineProperties(Constructor.prototype, protoProps);if (staticProps) _defineProperties(Constructor, staticProps);return Constructor;}var isArray = Array.isArray; +var isObject = function isObject(val) {return val !== null && typeof val === 'object';}; +var defaultDelimiters = ['{', '}'];var +BaseFormatter = /*#__PURE__*/function () { + function BaseFormatter() {_classCallCheck(this, BaseFormatter); + this._caches = Object.create(null); + }_createClass(BaseFormatter, [{ key: "interpolate", value: function interpolate( + message, values) {var delimiters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultDelimiters; + if (!values) { + return [message]; + } + var tokens = this._caches[message]; + if (!tokens) { + tokens = parse(message, delimiters); + this._caches[message] = tokens; + } + return compile(tokens, values); + } }]);return BaseFormatter;}();exports.Formatter = BaseFormatter; -function isFalse (v) { - return v === false +var RE_TOKEN_LIST_VALUE = /^(?:\d)+/; +var RE_TOKEN_NAMED_VALUE = /^(?:\w)+/; +function parse(format, _ref) {var _ref2 = _slicedToArray(_ref, 2),startDelimiter = _ref2[0],endDelimiter = _ref2[1]; + var tokens = []; + var position = 0; + var text = ''; + while (position < format.length) { + var char = format[position++]; + if (char === startDelimiter) { + if (text) { + tokens.push({ type: 'text', value: text }); + } + text = ''; + var sub = ''; + char = format[position++]; + while (char !== undefined && char !== endDelimiter) { + sub += char; + char = format[position++]; + } + var isClosed = char === endDelimiter; + var type = RE_TOKEN_LIST_VALUE.test(sub) ? + 'list' : + isClosed && RE_TOKEN_NAMED_VALUE.test(sub) ? + 'named' : + 'unknown'; + tokens.push({ value: sub, type: type }); + } + // else if (char === '%') { + // // when found rails i18n syntax, skip text capture + // if (format[position] !== '{') { + // text += char + // } + // } + else { + text += char; + } + } + text && tokens.push({ type: 'text', value: text }); + return tokens; } +function compile(tokens, values) { + var compiled = []; + var index = 0; + var mode = isArray(values) ? + 'list' : + isObject(values) ? + 'named' : + 'unknown'; + if (mode === 'unknown') { + return compiled; + } + while (index < tokens.length) { + var token = tokens[index]; + switch (token.type) { + case 'text': + compiled.push(token.value); + break; + case 'list': + compiled.push(values[parseInt(token.value, 10)]); + break; + case 'named': + if (mode === 'named') { + compiled.push(values[token.value]); + } else + { + if (true) { + console.warn("Type of token '".concat(token.type, "' and format of value '").concat(mode, "' don't match!")); + } + } + break; + case 'unknown': + if (true) { + console.warn("Detect 'unknown' type of token!"); + } + break;} -/** - * Check if value is primitive. - */ -function isPrimitive (value) { - return ( - typeof value === 'string' || - typeof value === 'number' || - // $flow-disable-line - typeof value === 'symbol' || - typeof value === 'boolean' - ) + index++; + } + return compiled; } -/** - * Quick object check - this is primarily used to tell - * Objects from primitive values when we know the value - * is a JSON-compliant type. - */ -function isObject (obj) { - return obj !== null && typeof obj === 'object' +var LOCALE_ZH_HANS = 'zh-Hans';exports.LOCALE_ZH_HANS = LOCALE_ZH_HANS; +var LOCALE_ZH_HANT = 'zh-Hant';exports.LOCALE_ZH_HANT = LOCALE_ZH_HANT; +var LOCALE_EN = 'en';exports.LOCALE_EN = LOCALE_EN; +var LOCALE_FR = 'fr';exports.LOCALE_FR = LOCALE_FR; +var LOCALE_ES = 'es';exports.LOCALE_ES = LOCALE_ES; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var hasOwn = function hasOwn(val, key) {return hasOwnProperty.call(val, key);}; +var defaultFormatter = new BaseFormatter(); +function include(str, parts) { + return !!parts.find(function (part) {return str.indexOf(part) !== -1;}); } - -/** - * Get the raw type string of a value, e.g., [object Object]. - */ -var _toString = Object.prototype.toString; - -function toRawType (value) { - return _toString.call(value).slice(8, -1) +function startsWith(str, parts) { + return parts.find(function (part) {return str.indexOf(part) === 0;}); } - -/** - * Strict object type check. Only returns true - * for plain JavaScript objects. - */ -function isPlainObject (obj) { - return _toString.call(obj) === '[object Object]' -} - -function isRegExp (v) { - return _toString.call(v) === '[object RegExp]' -} - -/** - * Check if val is a valid array index. - */ -function isValidArrayIndex (val) { - var n = parseFloat(String(val)); - return n >= 0 && Math.floor(n) === n && isFinite(val) -} - -function isPromise (val) { - return ( - isDef(val) && - typeof val.then === 'function' && - typeof val.catch === 'function' - ) -} - -/** - * Convert a value to a string that is actually rendered. - */ -function toString (val) { - return val == null - ? '' - : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) - ? JSON.stringify(val, null, 2) - : String(val) -} - -/** - * Convert an input value to a number for persistence. - * If the conversion fails, return original string. - */ -function toNumber (val) { - var n = parseFloat(val); - return isNaN(n) ? val : n -} - -/** - * Make a map and return a function for checking if a key - * is in that map. - */ -function makeMap ( - str, - expectsLowerCase -) { - var map = Object.create(null); - var list = str.split(','); - for (var i = 0; i < list.length; i++) { - map[list[i]] = true; - } - return expectsLowerCase - ? function (val) { return map[val.toLowerCase()]; } - : function (val) { return map[val]; } -} - -/** - * Check if a tag is a built-in tag. - */ -var isBuiltInTag = makeMap('slot,component', true); - -/** - * Check if an attribute is a reserved attribute. - */ -var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); - -/** - * Remove an item from an array. - */ -function remove (arr, item) { - if (arr.length) { - var index = arr.indexOf(item); - if (index > -1) { - return arr.splice(index, 1) - } +function normalizeLocale(locale, messages) { + if (!locale) { + return; } -} - -/** - * Check whether an object has the property. - */ -var hasOwnProperty = Object.prototype.hasOwnProperty; -function hasOwn (obj, key) { - return hasOwnProperty.call(obj, key) -} - -/** - * Create a cached version of a pure function. - */ -function cached (fn) { - var cache = Object.create(null); - return (function cachedFn (str) { - var hit = cache[str]; - return hit || (cache[str] = fn(str)) - }) -} - -/** - * Camelize a hyphen-delimited string. - */ -var camelizeRE = /-(\w)/g; -var camelize = cached(function (str) { - return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) -}); - -/** - * Capitalize a string. - */ -var capitalize = cached(function (str) { - return str.charAt(0).toUpperCase() + str.slice(1) -}); - -/** - * Hyphenate a camelCase string. - */ -var hyphenateRE = /\B([A-Z])/g; -var hyphenate = cached(function (str) { - return str.replace(hyphenateRE, '-$1').toLowerCase() -}); - -/** - * Simple bind polyfill for environments that do not support it, - * e.g., PhantomJS 1.x. Technically, we don't need this anymore - * since native bind is now performant enough in most browsers. - * But removing it would mean breaking code that was able to run in - * PhantomJS 1.x, so this must be kept for backward compatibility. - */ - -/* istanbul ignore next */ -function polyfillBind (fn, ctx) { - function boundFn (a) { - var l = arguments.length; - return l - ? l > 1 - ? fn.apply(ctx, arguments) - : fn.call(ctx, a) - : fn.call(ctx) + locale = locale.trim().replace(/_/g, '-'); + if (messages && messages[locale]) { + return locale; } - - boundFn._length = fn.length; - return boundFn -} - -function nativeBind (fn, ctx) { - return fn.bind(ctx) -} - -var bind = Function.prototype.bind - ? nativeBind - : polyfillBind; - -/** - * Convert an Array-like object to a real Array. - */ -function toArray (list, start) { - start = start || 0; - var i = list.length - start; - var ret = new Array(i); - while (i--) { - ret[i] = list[i + start]; + locale = locale.toLowerCase(); + if (locale.indexOf('zh') === 0) { + if (locale.indexOf('-hans') > -1) { + return LOCALE_ZH_HANS; + } + if (locale.indexOf('-hant') > -1) { + return LOCALE_ZH_HANT; + } + if (include(locale, ['-tw', '-hk', '-mo', '-cht'])) { + return LOCALE_ZH_HANT; + } + return LOCALE_ZH_HANS; } - return ret -} - -/** - * Mix properties into target object. - */ -function extend (to, _from) { - for (var key in _from) { - to[key] = _from[key]; + var lang = startsWith(locale, [LOCALE_EN, LOCALE_FR, LOCALE_ES]); + if (lang) { + return lang; } - return to -} - -/** - * Merge an Array of Objects into a single Object. - */ -function toObject (arr) { - var res = {}; - for (var i = 0; i < arr.length; i++) { - if (arr[i]) { - extend(res, arr[i]); +}var +I18n = /*#__PURE__*/function () { + function I18n(_ref3) {var locale = _ref3.locale,fallbackLocale = _ref3.fallbackLocale,messages = _ref3.messages,watcher = _ref3.watcher,formater = _ref3.formater;_classCallCheck(this, I18n); + this.locale = LOCALE_EN; + this.fallbackLocale = LOCALE_EN; + this.message = {}; + this.messages = {}; + this.watchers = []; + if (fallbackLocale) { + this.fallbackLocale = fallbackLocale; } - } - return res -} - -/* eslint-disable no-unused-vars */ - -/** - * Perform no operation. - * Stubbing args to make Flow happy without leaving useless transpiled code - * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). - */ -function noop (a, b, c) {} - -/** - * Always return false. - */ -var no = function (a, b, c) { return false; }; - -/* eslint-enable no-unused-vars */ - -/** - * Return the same value. - */ -var identity = function (_) { return _; }; - -/** - * Check if two values are loosely equal - that is, - * if they are plain objects, do they have the same shape? - */ -function looseEqual (a, b) { - if (a === b) { return true } - var isObjectA = isObject(a); - var isObjectB = isObject(b); - if (isObjectA && isObjectB) { - try { - var isArrayA = Array.isArray(a); - var isArrayB = Array.isArray(b); - if (isArrayA && isArrayB) { - return a.length === b.length && a.every(function (e, i) { - return looseEqual(e, b[i]) - }) - } else if (a instanceof Date && b instanceof Date) { - return a.getTime() === b.getTime() - } else if (!isArrayA && !isArrayB) { - var keysA = Object.keys(a); - var keysB = Object.keys(b); - return keysA.length === keysB.length && keysA.every(function (key) { - return looseEqual(a[key], b[key]) - }) - } else { - /* istanbul ignore next */ - return false - } - } catch (e) { - /* istanbul ignore next */ - return false - } - } else if (!isObjectA && !isObjectB) { - return String(a) === String(b) - } else { - return false - } -} - -/** - * Return the first index at which a loosely equal value can be - * found in the array (if value is a plain object, the array must - * contain an object of the same shape), or -1 if it is not present. - */ -function looseIndexOf (arr, val) { - for (var i = 0; i < arr.length; i++) { - if (looseEqual(arr[i], val)) { return i } - } - return -1 -} - -/** - * Ensure a function is called only once. - */ -function once (fn) { - var called = false; - return function () { - if (!called) { - called = true; - fn.apply(this, arguments); - } - } -} - -var ASSET_TYPES = [ - 'component', - 'directive', - 'filter' -]; - -var LIFECYCLE_HOOKS = [ - 'beforeCreate', - 'created', - 'beforeMount', - 'mounted', - 'beforeUpdate', - 'updated', - 'beforeDestroy', - 'destroyed', - 'activated', - 'deactivated', - 'errorCaptured', - 'serverPrefetch' -]; - -/* */ - - - -var config = ({ - /** - * Option merge strategies (used in core/util/options) - */ - // $flow-disable-line - optionMergeStrategies: Object.create(null), - - /** - * Whether to suppress warnings. - */ - silent: false, - - /** - * Show production mode tip message on boot? - */ - productionTip: "development" !== 'production', - - /** - * Whether to enable devtools - */ - devtools: "development" !== 'production', - - /** - * Whether to record perf - */ - performance: false, - - /** - * Error handler for watcher errors - */ - errorHandler: null, - - /** - * Warn handler for watcher warns - */ - warnHandler: null, - - /** - * Ignore certain custom elements - */ - ignoredElements: [], - - /** - * Custom user key aliases for v-on - */ - // $flow-disable-line - keyCodes: Object.create(null), - - /** - * Check if a tag is reserved so that it cannot be registered as a - * component. This is platform-dependent and may be overwritten. - */ - isReservedTag: no, - - /** - * Check if an attribute is reserved so that it cannot be used as a component - * prop. This is platform-dependent and may be overwritten. - */ - isReservedAttr: no, - - /** - * Check if a tag is an unknown element. - * Platform-dependent. - */ - isUnknownElement: no, - - /** - * Get the namespace of an element - */ - getTagNamespace: noop, - - /** - * Parse the real tag name for the specific platform. - */ - parsePlatformTagName: identity, - - /** - * Check if an attribute must be bound using property, e.g. value - * Platform-dependent. - */ - mustUseProp: no, - - /** - * Perform updates asynchronously. Intended to be used by Vue Test Utils - * This will significantly reduce performance if set to false. - */ - async: true, - - /** - * Exposed for legacy reasons - */ - _lifecycleHooks: LIFECYCLE_HOOKS -}); - -/* */ - -/** - * unicode letters used for parsing html tags, component names and property paths. - * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname - * skipping \u10000-\uEFFFF due to it freezing up PhantomJS - */ -var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; - -/** - * Check if a string starts with $ or _ - */ -function isReserved (str) { - var c = (str + '').charCodeAt(0); - return c === 0x24 || c === 0x5F -} - -/** - * Define a property. - */ -function def (obj, key, val, enumerable) { - Object.defineProperty(obj, key, { - value: val, - enumerable: !!enumerable, - writable: true, - configurable: true - }); -} - -/** - * Parse simple path. - */ -var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); -function parsePath (path) { - if (bailRE.test(path)) { - return - } - var segments = path.split('.'); - return function (obj) { - for (var i = 0; i < segments.length; i++) { - if (!obj) { return } - obj = obj[segments[i]]; + this.formater = formater || defaultFormatter; + this.messages = messages || {}; + this.setLocale(locale || LOCALE_EN); + if (watcher) { + this.watchLocale(watcher); } - return obj - } -} - -/* */ - -// can we use __proto__? -var hasProto = '__proto__' in {}; - -// Browser environment sniffing -var inBrowser = typeof window !== 'undefined'; -var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; -var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); -var UA = inBrowser && window.navigator.userAgent.toLowerCase(); -var isIE = UA && /msie|trident/.test(UA); -var isIE9 = UA && UA.indexOf('msie 9.0') > 0; -var isEdge = UA && UA.indexOf('edge/') > 0; -var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); -var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); -var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; -var isPhantomJS = UA && /phantomjs/.test(UA); -var isFF = UA && UA.match(/firefox\/(\d+)/); - -// Firefox has a "watch" function on Object.prototype... -var nativeWatch = ({}).watch; -if (inBrowser) { - try { - var opts = {}; - Object.defineProperty(opts, 'passive', ({ - get: function get () { + }_createClass(I18n, [{ key: "setLocale", value: function setLocale( + locale) {var _this = this; + var oldLocale = this.locale; + this.locale = normalizeLocale(locale, this.messages) || this.fallbackLocale; + if (!this.messages[this.locale]) { + // 可能初始化时不存在 + this.messages[this.locale] = {}; + } + this.message = this.messages[this.locale]; + // 仅发生变化时,通知 + if (oldLocale !== this.locale) { + this.watchers.forEach(function (watcher) { + watcher(_this.locale, oldLocale); + }); + } + } }, { key: "getLocale", value: function getLocale() + { + return this.locale; + } }, { key: "watchLocale", value: function watchLocale( + fn) {var _this2 = this; + var index = this.watchers.push(fn) - 1; + return function () { + _this2.watchers.splice(index, 1); + }; + } }, { key: "add", value: function add( + locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + var curMessages = this.messages[locale]; + if (curMessages) { + if (override) { + Object.assign(curMessages, message); + } else + { + Object.keys(message).forEach(function (key) { + if (!hasOwn(curMessages, key)) { + curMessages[key] = message[key]; + } + }); + } + } else + { + this.messages[locale] = message; } - })); // https://github.com/facebook/flow/issues/285 - window.addEventListener('test-passive', null, opts); - } catch (e) {} -} - -// this needs to be lazy-evaled because vue may be required before -// vue-server-renderer can set VUE_ENV -var _isServer; -var isServerRendering = function () { - if (_isServer === undefined) { - /* istanbul ignore if */ - if (!inBrowser && !inWeex && typeof global !== 'undefined') { - // detect presence of vue-server-renderer and avoid - // Webpack shimming the process - _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; - } else { - _isServer = false; - } - } - return _isServer -}; + } }, { key: "f", value: function f( + message, values, delimiters) { + return this.formater.interpolate(message, values, delimiters).join(''); + } }, { key: "t", value: function t( + key, locale, values) { + var message = this.message; + if (typeof locale === 'string') { + locale = normalizeLocale(locale, this.messages); + locale && (message = this.messages[locale]); + } else + { + values = locale; + } + if (!hasOwn(message, key)) { + console.warn("Cannot translate the value of keypath ".concat(key, ". Use the value of keypath as default.")); + return key; + } + return this.formater.interpolate(message[key], values).join(''); + } }]);return I18n;}();exports.I18n = I18n; -// detect devtools -var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; -/* istanbul ignore next */ -function isNative (Ctor) { - return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) +function watchAppLocale(appVm, i18n) { + // 需要保证 watch 的触发在组件渲染之前 + if (appVm.$watchLocale) { + // vue2 + appVm.$watchLocale(function (newLocale) { + i18n.setLocale(newLocale); + }); + } else + { + appVm.$watch(function () {return appVm.$locale;}, function (newLocale) { + i18n.setLocale(newLocale); + }); + } } - -var hasSymbol = - typeof Symbol !== 'undefined' && isNative(Symbol) && - typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); - -var _Set; -/* istanbul ignore if */ // $flow-disable-line -if (typeof Set !== 'undefined' && isNative(Set)) { - // use native Set when available. - _Set = Set; -} else { - // a non-standard Set polyfill that only works with primitive keys. - _Set = /*@__PURE__*/(function () { - function Set () { - this.set = Object.create(null); - } - Set.prototype.has = function has (key) { - return this.set[key] === true - }; - Set.prototype.add = function add (key) { - this.set[key] = true; - }; - Set.prototype.clear = function clear () { - this.set = Object.create(null); - }; - - return Set; - }()); +function getDefaultLocale() { + if (typeof uni !== 'undefined' && uni.getLocale) { + return uni.getLocale(); + } + // 小程序平台,uni 和 uni-i18n 互相引用,导致访问不到 uni,故在 global 上挂了 getLocale + if (typeof global !== 'undefined' && global.getLocale) { + return global.getLocale(); + } + return LOCALE_EN; } +function initVueI18n(locale) {var messages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};var fallbackLocale = arguments.length > 2 ? arguments[2] : undefined;var watcher = arguments.length > 3 ? arguments[3] : undefined; + // 兼容旧版本入参 + if (typeof locale !== 'string') {var _ref4 = + [ + messages, + locale];locale = _ref4[0];messages = _ref4[1]; -/* */ - -var warn = noop; -var tip = noop; -var generateComponentTrace = (noop); // work around flow check -var formatComponentName = (noop); - -if (true) { - var hasConsole = typeof console !== 'undefined'; - var classifyRE = /(?:^|[-_])(\w)/g; - var classify = function (str) { return str - .replace(classifyRE, function (c) { return c.toUpperCase(); }) - .replace(/[-_]/g, ''); }; - - warn = function (msg, vm) { - var trace = vm ? generateComponentTrace(vm) : ''; - - if (config.warnHandler) { - config.warnHandler.call(null, msg, vm, trace); - } else if (hasConsole && (!config.silent)) { - console.error(("[Vue warn]: " + msg + trace)); - } - }; - - tip = function (msg, vm) { - if (hasConsole && (!config.silent)) { - console.warn("[Vue tip]: " + msg + ( - vm ? generateComponentTrace(vm) : '' - )); - } - }; - - formatComponentName = function (vm, includeFile) { - if (vm.$root === vm) { - if (vm.$options && vm.$options.__file) { // fixed by xxxxxx - return ('') + vm.$options.__file - } - return '' - } - var options = typeof vm === 'function' && vm.cid != null - ? vm.options - : vm._isVue - ? vm.$options || vm.constructor.options - : vm; - var name = options.name || options._componentTag; - var file = options.__file; - if (!name && file) { - var match = file.match(/([^/\\]+)\.vue$/); - name = match && match[1]; - } - - return ( - (name ? ("<" + (classify(name)) + ">") : "") + - (file && includeFile !== false ? (" at " + file) : '') - ) - }; + } + if (typeof locale !== 'string') { + // 因为小程序平台,uni-i18n 和 uni 互相引用,导致此时访问 uni 时,为 undefined + locale = getDefaultLocale(); + } + if (typeof fallbackLocale !== 'string') { + fallbackLocale = + typeof __uniConfig !== 'undefined' && __uniConfig.fallbackLocale || + LOCALE_EN; + } + var i18n = new I18n({ + locale: locale, + fallbackLocale: fallbackLocale, + messages: messages, + watcher: watcher }); - var repeat = function (str, n) { - var res = ''; - while (n) { - if (n % 2 === 1) { res += str; } - if (n > 1) { str += str; } - n >>= 1; + var _t = function t(key, values) { + if (typeof getApp !== 'function') { + // app view + /* eslint-disable no-func-assign */ + _t = function t(key, values) { + return i18n.t(key, values); + }; + } else + { + var isWatchedAppLocale = false; + _t = function t(key, values) { + var appVm = getApp().$vm; + // 可能$vm还不存在,比如在支付宝小程序中,组件定义较早,在props的default里使用了t()函数(如uni-goods-nav),此时app还未初始化 + // options: { + // type: Array, + // default () { + // return [{ + // icon: 'shop', + // text: t("uni-goods-nav.options.shop"), + // }, { + // icon: 'cart', + // text: t("uni-goods-nav.options.cart") + // }] + // } + // }, + if (appVm) { + // 触发响应式 + appVm.$locale; + if (!isWatchedAppLocale) { + isWatchedAppLocale = true; + watchAppLocale(appVm, i18n); + } + } + return i18n.t(key, values); + }; } - return res + return _t(key, values); }; + return { + i18n: i18n, + f: function f(message, values, delimiters) { + return i18n.f(message, values, delimiters); + }, + t: function t(key, values) { + return _t(key, values); + }, + add: function add(locale, message) {var override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + return i18n.add(locale, message, override); + }, + watch: function watch(fn) { + return i18n.watchLocale(fn); + }, + getLocale: function getLocale() { + return i18n.getLocale(); + }, + setLocale: function setLocale(newLocale) { + return i18n.setLocale(newLocale); + } }; - generateComponentTrace = function (vm) { - if (vm._isVue && vm.$parent) { - var tree = []; - var currentRecursiveSequence = 0; - while (vm && vm.$options.name !== 'PageBody') { - if (tree.length > 0) { - var last = tree[tree.length - 1]; - if (last.constructor === vm.constructor) { - currentRecursiveSequence++; - vm = vm.$parent; - continue - } else if (currentRecursiveSequence > 0) { - tree[tree.length - 1] = [last, currentRecursiveSequence]; - currentRecursiveSequence = 0; - } - } - !vm.$options.isReserved && tree.push(vm); - vm = vm.$parent; +} + +var isString = function isString(val) {return typeof val === 'string';};exports.isString = isString; +var formater; +function hasI18nJson(jsonObj, delimiters) { + if (!formater) { + formater = new BaseFormatter(); + } + return walkJsonObj(jsonObj, function (jsonObj, key) { + var value = jsonObj[key]; + if (isString(value)) { + if (isI18nStr(value, delimiters)) { + return true; } - return '\n\nfound in\n\n' + tree - .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) - ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") - : formatComponentName(vm))); }) - .join('\n') - } else { - return ("\n\n(found in " + (formatComponentName(vm)) + ")") + } else + { + return hasI18nJson(value, delimiters); } - }; + }); } - -/* */ - -var uid = 0; - -/** - * A dep is an observable that can have multiple - * directives subscribing to it. - */ -var Dep = function Dep () { - this.id = uid++; - this.subs = []; -}; - -Dep.prototype.addSub = function addSub (sub) { - this.subs.push(sub); -}; - -Dep.prototype.removeSub = function removeSub (sub) { - remove(this.subs, sub); -}; - -Dep.prototype.depend = function depend () { - if (Dep.SharedObject.target) { - Dep.SharedObject.target.addDep(this); +function parseI18nJson(jsonObj, values, delimiters) { + if (!formater) { + formater = new BaseFormatter(); } -}; - -Dep.prototype.notify = function notify () { - // stabilize the subscriber list first - var subs = this.subs.slice(); - if ( true && !config.async) { - // subs aren't sorted in scheduler if not running async - // we need to sort them now to make sure they fire in correct - // order - subs.sort(function (a, b) { return a.id - b.id; }); + walkJsonObj(jsonObj, function (jsonObj, key) { + var value = jsonObj[key]; + if (isString(value)) { + if (isI18nStr(value, delimiters)) { + jsonObj[key] = compileStr(value, values, delimiters); + } + } else + { + parseI18nJson(value, values, delimiters); + } + }); + return jsonObj; +} +function compileI18nJsonStr(jsonStr, _ref5) {var locale = _ref5.locale,locales = _ref5.locales,delimiters = _ref5.delimiters; + if (!isI18nStr(jsonStr, delimiters)) { + return jsonStr; } - for (var i = 0, l = subs.length; i < l; i++) { - subs[i].update(); + if (!formater) { + formater = new BaseFormatter(); } -}; - -// The current target watcher being evaluated. -// This is globally unique because only one watcher -// can be evaluated at a time. -// fixed by xxxxxx (nvue shared vuex) -/* eslint-disable no-undef */ -Dep.SharedObject = {}; -Dep.SharedObject.target = null; -Dep.SharedObject.targetStack = []; - -function pushTarget (target) { - Dep.SharedObject.targetStack.push(target); - Dep.SharedObject.target = target; - Dep.target = target; -} + var localeValues = []; + Object.keys(locales).forEach(function (name) { + if (name !== locale) { + localeValues.push({ + locale: name, + values: locales[name] }); -function popTarget () { - Dep.SharedObject.targetStack.pop(); - Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1]; - Dep.target = Dep.SharedObject.target; + } + }); + localeValues.unshift({ locale: locale, values: locales[locale] }); + try { + return JSON.stringify(compileJsonObj(JSON.parse(jsonStr), localeValues, delimiters), null, 2); + } + catch (e) {} + return jsonStr; } - -/* */ - -var VNode = function VNode ( - tag, - data, - children, - text, - elm, - context, - componentOptions, - asyncFactory -) { - this.tag = tag; - this.data = data; - this.children = children; - this.text = text; - this.elm = elm; - this.ns = undefined; - this.context = context; - this.fnContext = undefined; - this.fnOptions = undefined; - this.fnScopeId = undefined; - this.key = data && data.key; - this.componentOptions = componentOptions; - this.componentInstance = undefined; - this.parent = undefined; - this.raw = false; - this.isStatic = false; - this.isRootInsert = true; - this.isComment = false; - this.isCloned = false; - this.isOnce = false; - this.asyncFactory = asyncFactory; - this.asyncMeta = undefined; - this.isAsyncPlaceholder = false; -}; - -var prototypeAccessors = { child: { configurable: true } }; - -// DEPRECATED: alias for componentInstance for backwards compat. -/* istanbul ignore next */ -prototypeAccessors.child.get = function () { - return this.componentInstance -}; - -Object.defineProperties( VNode.prototype, prototypeAccessors ); - -var createEmptyVNode = function (text) { - if ( text === void 0 ) text = ''; - - var node = new VNode(); - node.text = text; - node.isComment = true; - return node -}; - -function createTextVNode (val) { - return new VNode(undefined, undefined, undefined, String(val)) +function isI18nStr(value, delimiters) { + return value.indexOf(delimiters[0]) > -1; } - -// optimized shallow clone -// used for static nodes and slot nodes because they may be reused across -// multiple renders, cloning them avoids errors when DOM manipulations rely -// on their elm reference. -function cloneVNode (vnode) { - var cloned = new VNode( - vnode.tag, - vnode.data, - // #7975 - // clone children array to avoid mutating original in case of cloning - // a child. - vnode.children && vnode.children.slice(), - vnode.text, - vnode.elm, - vnode.context, - vnode.componentOptions, - vnode.asyncFactory - ); - cloned.ns = vnode.ns; - cloned.isStatic = vnode.isStatic; - cloned.key = vnode.key; - cloned.isComment = vnode.isComment; - cloned.fnContext = vnode.fnContext; - cloned.fnOptions = vnode.fnOptions; - cloned.fnScopeId = vnode.fnScopeId; - cloned.asyncMeta = vnode.asyncMeta; - cloned.isCloned = true; - return cloned +function compileStr(value, values, delimiters) { + return formater.interpolate(value, values, delimiters).join(''); } - -/* - * not type checking this file because flow doesn't play well with - * dynamically accessing methods on Array prototype - */ - -var arrayProto = Array.prototype; -var arrayMethods = Object.create(arrayProto); - -var methodsToPatch = [ - 'push', - 'pop', - 'shift', - 'unshift', - 'splice', - 'sort', - 'reverse' -]; - -/** - * Intercept mutating methods and emit events - */ -methodsToPatch.forEach(function (method) { - // cache original method - var original = arrayProto[method]; - def(arrayMethods, method, function mutator () { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - - var result = original.apply(this, args); - var ob = this.__ob__; - var inserted; - switch (method) { - case 'push': - case 'unshift': - inserted = args; - break - case 'splice': - inserted = args.slice(2); - break +function compileValue(jsonObj, key, localeValues, delimiters) { + var value = jsonObj[key]; + if (isString(value)) { + // 存在国际化 + if (isI18nStr(value, delimiters)) { + jsonObj[key] = compileStr(value, localeValues[0].values, delimiters); + if (localeValues.length > 1) { + // 格式化国际化语言 + var valueLocales = jsonObj[key + 'Locales'] = {}; + localeValues.forEach(function (localValue) { + valueLocales[localValue.locale] = compileStr(value, localValue.values, delimiters); + }); + } } - if (inserted) { ob.observeArray(inserted); } - // notify change - ob.dep.notify(); - return result + } else + { + compileJsonObj(value, localeValues, delimiters); + } +} +function compileJsonObj(jsonObj, localeValues, delimiters) { + walkJsonObj(jsonObj, function (jsonObj, key) { + compileValue(jsonObj, key, localeValues, delimiters); }); -}); - -/* */ - -var arrayKeys = Object.getOwnPropertyNames(arrayMethods); - -/** - * In some cases we may want to disable observation inside a component's - * update computation. - */ -var shouldObserve = true; - -function toggleObserving (value) { - shouldObserve = value; + return jsonObj; } - -/** - * Observer class that is attached to each observed - * object. Once attached, the observer converts the target - * object's property keys into getter/setters that - * collect dependencies and dispatch updates. - */ -var Observer = function Observer (value) { - this.value = value; - this.dep = new Dep(); - this.vmCount = 0; - def(value, '__ob__', this); - if (Array.isArray(value)) { - if (hasProto) { - {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑 - if(value.push !== value.__proto__.push){ - copyAugment(value, arrayMethods, arrayKeys); - } else { - protoAugment(value, arrayMethods); - } +function walkJsonObj(jsonObj, walk) { + if (isArray(jsonObj)) { + for (var i = 0; i < jsonObj.length; i++) { + if (walk(jsonObj, i)) { + return true; + } + } + } else + if (isObject(jsonObj)) { + for (var key in jsonObj) { + if (walk(jsonObj, key)) { + return true; } - } else { - copyAugment(value, arrayMethods, arrayKeys); } - this.observeArray(value); - } else { - this.walk(value); } -}; + return false; +} -/** - * Walk through all properties and convert them into - * getter/setters. This method should only be called when - * value type is Object. - */ -Observer.prototype.walk = function walk (obj) { - var keys = Object.keys(obj); - for (var i = 0; i < keys.length; i++) { - defineReactive$$1(obj, keys[i]); +function resolveLocale(locales) { + return function (locale) { + if (!locale) { + return locale; + } + locale = normalizeLocale(locale) || locale; + return resolveLocaleChain(locale).find(function (locale) {return locales.indexOf(locale) > -1;}); + }; +} +function resolveLocaleChain(locale) { + var chain = []; + var tokens = locale.split('-'); + while (tokens.length) { + chain.push(tokens.join('-')); + tokens.pop(); } -}; + return chain; +} +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-toutiao/dist/index.js */ 1)["default"], __webpack_require__(/*! ./../../../webpack/buildin/global.js */ 2))) -/** - * Observe a list of Array items. +/***/ }), +/* 4 */ +/*!******************************************************************************************!*\ + !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/mp-vue/dist/mp.runtime.esm.js ***! + \******************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* WEBPACK VAR INJECTION */(function(global) {/*! + * Vue.js v2.6.11 + * (c) 2014-2022 Evan You + * Released under the MIT License. */ -Observer.prototype.observeArray = function observeArray (items) { - for (var i = 0, l = items.length; i < l; i++) { - observe(items[i]); - } -}; +/* */ -// helpers +var emptyObject = Object.freeze({}); -/** - * Augment a target Object or Array by intercepting - * the prototype chain using __proto__ - */ -function protoAugment (target, src) { - /* eslint-disable no-proto */ - target.__proto__ = src; - /* eslint-enable no-proto */ +// These helpers produce better VM code in JS engines due to their +// explicitness and function inlining. +function isUndef (v) { + return v === undefined || v === null +} + +function isDef (v) { + return v !== undefined && v !== null +} + +function isTrue (v) { + return v === true +} + +function isFalse (v) { + return v === false } /** - * Augment a target Object or Array by defining - * hidden properties. + * Check if value is primitive. */ -/* istanbul ignore next */ -function copyAugment (target, src, keys) { - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - def(target, key, src[key]); - } +function isPrimitive (value) { + return ( + typeof value === 'string' || + typeof value === 'number' || + // $flow-disable-line + typeof value === 'symbol' || + typeof value === 'boolean' + ) } /** - * Attempt to create an observer instance for a value, - * returns the new observer if successfully observed, - * or the existing observer if the value already has one. + * Quick object check - this is primarily used to tell + * Objects from primitive values when we know the value + * is a JSON-compliant type. */ -function observe (value, asRootData) { - if (!isObject(value) || value instanceof VNode) { - return - } - var ob; - if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { - ob = value.__ob__; - } else if ( - shouldObserve && - !isServerRendering() && - (Array.isArray(value) || isPlainObject(value)) && - Object.isExtensible(value) && - !value._isVue - ) { - ob = new Observer(value); - } - if (asRootData && ob) { - ob.vmCount++; - } - return ob +function isObject (obj) { + return obj !== null && typeof obj === 'object' } /** - * Define a reactive property on an Object. + * Get the raw type string of a value, e.g., [object Object]. */ -function defineReactive$$1 ( - obj, - key, - val, - customSetter, - shallow -) { - var dep = new Dep(); - - var property = Object.getOwnPropertyDescriptor(obj, key); - if (property && property.configurable === false) { - return - } - - // cater for pre-defined getter/setters - var getter = property && property.get; - var setter = property && property.set; - if ((!getter || setter) && arguments.length === 2) { - val = obj[key]; - } +var _toString = Object.prototype.toString; - var childOb = !shallow && observe(val); - Object.defineProperty(obj, key, { - enumerable: true, - configurable: true, - get: function reactiveGetter () { - var value = getter ? getter.call(obj) : val; - if (Dep.SharedObject.target) { // fixed by xxxxxx - dep.depend(); - if (childOb) { - childOb.dep.depend(); - if (Array.isArray(value)) { - dependArray(value); - } - } - } - return value - }, - set: function reactiveSetter (newVal) { - var value = getter ? getter.call(obj) : val; - /* eslint-disable no-self-compare */ - if (newVal === value || (newVal !== newVal && value !== value)) { - return - } - /* eslint-enable no-self-compare */ - if ( true && customSetter) { - customSetter(); - } - // #7981: for accessor properties without setter - if (getter && !setter) { return } - if (setter) { - setter.call(obj, newVal); - } else { - val = newVal; - } - childOb = !shallow && observe(newVal); - dep.notify(); - } - }); +function toRawType (value) { + return _toString.call(value).slice(8, -1) } /** - * Set a property on an object. Adds the new property and - * triggers change notification if the property doesn't - * already exist. + * Strict object type check. Only returns true + * for plain JavaScript objects. */ -function set (target, key, val) { - if ( true && - (isUndef(target) || isPrimitive(target)) - ) { - warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); - } - if (Array.isArray(target) && isValidArrayIndex(key)) { - target.length = Math.max(target.length, key); - target.splice(key, 1, val); - return val - } - if (key in target && !(key in Object.prototype)) { - target[key] = val; - return val - } - var ob = (target).__ob__; - if (target._isVue || (ob && ob.vmCount)) { - true && warn( - 'Avoid adding reactive properties to a Vue instance or its root $data ' + - 'at runtime - declare it upfront in the data option.' - ); - return val - } - if (!ob) { - target[key] = val; - return val - } - defineReactive$$1(ob.value, key, val); - ob.dep.notify(); - return val +function isPlainObject (obj) { + return _toString.call(obj) === '[object Object]' +} + +function isRegExp (v) { + return _toString.call(v) === '[object RegExp]' } /** - * Delete a property and trigger change if necessary. + * Check if val is a valid array index. */ -function del (target, key) { - if ( true && - (isUndef(target) || isPrimitive(target)) - ) { - warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); - } - if (Array.isArray(target) && isValidArrayIndex(key)) { - target.splice(key, 1); - return - } - var ob = (target).__ob__; - if (target._isVue || (ob && ob.vmCount)) { - true && warn( - 'Avoid deleting properties on a Vue instance or its root $data ' + - '- just set it to null.' - ); - return - } - if (!hasOwn(target, key)) { - return - } - delete target[key]; - if (!ob) { - return - } - ob.dep.notify(); +function isValidArrayIndex (val) { + var n = parseFloat(String(val)); + return n >= 0 && Math.floor(n) === n && isFinite(val) +} + +function isPromise (val) { + return ( + isDef(val) && + typeof val.then === 'function' && + typeof val.catch === 'function' + ) } /** - * Collect dependencies on array elements when the array is touched, since - * we cannot intercept array element access like property getters. + * Convert a value to a string that is actually rendered. */ -function dependArray (value) { - for (var e = (void 0), i = 0, l = value.length; i < l; i++) { - e = value[i]; - e && e.__ob__ && e.__ob__.dep.depend(); - if (Array.isArray(e)) { - dependArray(e); - } - } +function toString (val) { + return val == null + ? '' + : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) + ? JSON.stringify(val, null, 2) + : String(val) } -/* */ - /** - * Option overwriting strategies are functions that handle - * how to merge a parent option value and a child option - * value into the final value. + * Convert an input value to a number for persistence. + * If the conversion fails, return original string. */ -var strats = config.optionMergeStrategies; +function toNumber (val) { + var n = parseFloat(val); + return isNaN(n) ? val : n +} /** - * Options with restrictions + * Make a map and return a function for checking if a key + * is in that map. */ -if (true) { - strats.el = strats.propsData = function (parent, child, vm, key) { - if (!vm) { - warn( - "option \"" + key + "\" can only be used during instance " + - 'creation with the `new` keyword.' - ); - } - return defaultStrat(parent, child) - }; +function makeMap ( + str, + expectsLowerCase +) { + var map = Object.create(null); + var list = str.split(','); + for (var i = 0; i < list.length; i++) { + map[list[i]] = true; + } + return expectsLowerCase + ? function (val) { return map[val.toLowerCase()]; } + : function (val) { return map[val]; } } /** - * Helper that recursively merges two data objects together. + * Check if a tag is a built-in tag. */ -function mergeData (to, from) { - if (!from) { return to } - var key, toVal, fromVal; +var isBuiltInTag = makeMap('slot,component', true); - var keys = hasSymbol - ? Reflect.ownKeys(from) - : Object.keys(from); +/** + * Check if an attribute is a reserved attribute. + */ +var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - // in case the object is already observed... - if (key === '__ob__') { continue } - toVal = to[key]; - fromVal = from[key]; - if (!hasOwn(to, key)) { - set(to, key, fromVal); - } else if ( - toVal !== fromVal && - isPlainObject(toVal) && - isPlainObject(fromVal) - ) { - mergeData(toVal, fromVal); +/** + * Remove an item from an array. + */ +function remove (arr, item) { + if (arr.length) { + var index = arr.indexOf(item); + if (index > -1) { + return arr.splice(index, 1) } } - return to } /** - * Data + * Check whether an object has the property. */ -function mergeDataOrFn ( - parentVal, - childVal, - vm -) { - if (!vm) { - // in a Vue.extend merge, both should be functions - if (!childVal) { - return parentVal - } - if (!parentVal) { - return childVal - } - // when parentVal & childVal are both present, - // we need to return a function that returns the - // merged result of both functions... no need to - // check if parentVal is a function here because - // it has to be a function to pass previous merges. - return function mergedDataFn () { - return mergeData( - typeof childVal === 'function' ? childVal.call(this, this) : childVal, - typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal - ) - } - } else { - return function mergedInstanceDataFn () { - // instance merge - var instanceData = typeof childVal === 'function' - ? childVal.call(vm, vm) - : childVal; - var defaultData = typeof parentVal === 'function' - ? parentVal.call(vm, vm) - : parentVal; - if (instanceData) { - return mergeData(instanceData, defaultData) - } else { - return defaultData - } - } - } +var hasOwnProperty = Object.prototype.hasOwnProperty; +function hasOwn (obj, key) { + return hasOwnProperty.call(obj, key) } -strats.data = function ( - parentVal, - childVal, - vm -) { - if (!vm) { - if (childVal && typeof childVal !== 'function') { - true && warn( - 'The "data" option should be a function ' + - 'that returns a per-instance value in component ' + - 'definitions.', - vm - ); +/** + * Create a cached version of a pure function. + */ +function cached (fn) { + var cache = Object.create(null); + return (function cachedFn (str) { + var hit = cache[str]; + return hit || (cache[str] = fn(str)) + }) +} - return parentVal - } - return mergeDataOrFn(parentVal, childVal) - } +/** + * Camelize a hyphen-delimited string. + */ +var camelizeRE = /-(\w)/g; +var camelize = cached(function (str) { + return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) +}); + +/** + * Capitalize a string. + */ +var capitalize = cached(function (str) { + return str.charAt(0).toUpperCase() + str.slice(1) +}); - return mergeDataOrFn(parentVal, childVal, vm) -}; +/** + * Hyphenate a camelCase string. + */ +var hyphenateRE = /\B([A-Z])/g; +var hyphenate = cached(function (str) { + return str.replace(hyphenateRE, '-$1').toLowerCase() +}); /** - * Hooks and props are merged as arrays. + * Simple bind polyfill for environments that do not support it, + * e.g., PhantomJS 1.x. Technically, we don't need this anymore + * since native bind is now performant enough in most browsers. + * But removing it would mean breaking code that was able to run in + * PhantomJS 1.x, so this must be kept for backward compatibility. */ -function mergeHook ( - parentVal, - childVal -) { - var res = childVal - ? parentVal - ? parentVal.concat(childVal) - : Array.isArray(childVal) - ? childVal - : [childVal] - : parentVal; - return res - ? dedupeHooks(res) - : res -} -function dedupeHooks (hooks) { - var res = []; - for (var i = 0; i < hooks.length; i++) { - if (res.indexOf(hooks[i]) === -1) { - res.push(hooks[i]); - } +/* istanbul ignore next */ +function polyfillBind (fn, ctx) { + function boundFn (a) { + var l = arguments.length; + return l + ? l > 1 + ? fn.apply(ctx, arguments) + : fn.call(ctx, a) + : fn.call(ctx) } - return res + + boundFn._length = fn.length; + return boundFn } -LIFECYCLE_HOOKS.forEach(function (hook) { - strats[hook] = mergeHook; -}); +function nativeBind (fn, ctx) { + return fn.bind(ctx) +} + +var bind = Function.prototype.bind + ? nativeBind + : polyfillBind; /** - * Assets - * - * When a vm is present (instance creation), we need to do - * a three-way merge between constructor options, instance - * options and parent options. + * Convert an Array-like object to a real Array. */ -function mergeAssets ( - parentVal, - childVal, - vm, - key -) { - var res = Object.create(parentVal || null); - if (childVal) { - true && assertObjectType(key, childVal, vm); - return extend(res, childVal) - } else { - return res +function toArray (list, start) { + start = start || 0; + var i = list.length - start; + var ret = new Array(i); + while (i--) { + ret[i] = list[i + start]; } + return ret } -ASSET_TYPES.forEach(function (type) { - strats[type + 's'] = mergeAssets; -}); - /** - * Watchers. - * - * Watchers hashes should not overwrite one - * another, so we merge them as arrays. + * Mix properties into target object. */ -strats.watch = function ( - parentVal, - childVal, - vm, - key -) { - // work around Firefox's Object.prototype.watch... - if (parentVal === nativeWatch) { parentVal = undefined; } - if (childVal === nativeWatch) { childVal = undefined; } - /* istanbul ignore if */ - if (!childVal) { return Object.create(parentVal || null) } - if (true) { - assertObjectType(key, childVal, vm); - } - if (!parentVal) { return childVal } - var ret = {}; - extend(ret, parentVal); - for (var key$1 in childVal) { - var parent = ret[key$1]; - var child = childVal[key$1]; - if (parent && !Array.isArray(parent)) { - parent = [parent]; - } - ret[key$1] = parent - ? parent.concat(child) - : Array.isArray(child) ? child : [child]; +function extend (to, _from) { + for (var key in _from) { + to[key] = _from[key]; } - return ret -}; + return to +} /** - * Other object hashes. + * Merge an Array of Objects into a single Object. */ -strats.props = -strats.methods = -strats.inject = -strats.computed = function ( - parentVal, - childVal, - vm, - key -) { - if (childVal && "development" !== 'production') { - assertObjectType(key, childVal, vm); +function toObject (arr) { + var res = {}; + for (var i = 0; i < arr.length; i++) { + if (arr[i]) { + extend(res, arr[i]); + } } - if (!parentVal) { return childVal } - var ret = Object.create(null); - extend(ret, parentVal); - if (childVal) { extend(ret, childVal); } - return ret -}; -strats.provide = mergeDataOrFn; + return res +} + +/* eslint-disable no-unused-vars */ /** - * Default strategy. + * Perform no operation. + * Stubbing args to make Flow happy without leaving useless transpiled code + * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). */ -var defaultStrat = function (parentVal, childVal) { - return childVal === undefined - ? parentVal - : childVal -}; +function noop (a, b, c) {} /** - * Validate component names + * Always return false. */ -function checkComponents (options) { - for (var key in options.components) { - validateComponentName(key); - } -} +var no = function (a, b, c) { return false; }; -function validateComponentName (name) { - if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) { - warn( - 'Invalid component name: "' + name + '". Component names ' + - 'should conform to valid custom element name in html5 specification.' - ); - } - if (isBuiltInTag(name) || config.isReservedTag(name)) { - warn( - 'Do not use built-in or reserved HTML elements as component ' + - 'id: ' + name - ); - } -} +/* eslint-enable no-unused-vars */ /** - * Ensure all props option syntax are normalized into the - * Object-based format. + * Return the same value. */ -function normalizeProps (options, vm) { - var props = options.props; - if (!props) { return } - var res = {}; - var i, val, name; - if (Array.isArray(props)) { - i = props.length; - while (i--) { - val = props[i]; - if (typeof val === 'string') { - name = camelize(val); - res[name] = { type: null }; - } else if (true) { - warn('props must be strings when using array syntax.'); +var identity = function (_) { return _; }; + +/** + * Check if two values are loosely equal - that is, + * if they are plain objects, do they have the same shape? + */ +function looseEqual (a, b) { + if (a === b) { return true } + var isObjectA = isObject(a); + var isObjectB = isObject(b); + if (isObjectA && isObjectB) { + try { + var isArrayA = Array.isArray(a); + var isArrayB = Array.isArray(b); + if (isArrayA && isArrayB) { + return a.length === b.length && a.every(function (e, i) { + return looseEqual(e, b[i]) + }) + } else if (a instanceof Date && b instanceof Date) { + return a.getTime() === b.getTime() + } else if (!isArrayA && !isArrayB) { + var keysA = Object.keys(a); + var keysB = Object.keys(b); + return keysA.length === keysB.length && keysA.every(function (key) { + return looseEqual(a[key], b[key]) + }) + } else { + /* istanbul ignore next */ + return false } + } catch (e) { + /* istanbul ignore next */ + return false } - } else if (isPlainObject(props)) { - for (var key in props) { - val = props[key]; - name = camelize(key); - res[name] = isPlainObject(val) - ? val - : { type: val }; - } - } else if (true) { - warn( - "Invalid value for option \"props\": expected an Array or an Object, " + - "but got " + (toRawType(props)) + ".", - vm - ); + } else if (!isObjectA && !isObjectB) { + return String(a) === String(b) + } else { + return false } - options.props = res; } /** - * Normalize all injections into Object-based format + * Return the first index at which a loosely equal value can be + * found in the array (if value is a plain object, the array must + * contain an object of the same shape), or -1 if it is not present. */ -function normalizeInject (options, vm) { - var inject = options.inject; - if (!inject) { return } - var normalized = options.inject = {}; - if (Array.isArray(inject)) { - for (var i = 0; i < inject.length; i++) { - normalized[inject[i]] = { from: inject[i] }; - } - } else if (isPlainObject(inject)) { - for (var key in inject) { - var val = inject[key]; - normalized[key] = isPlainObject(val) - ? extend({ from: key }, val) - : { from: val }; - } - } else if (true) { - warn( - "Invalid value for option \"inject\": expected an Array or an Object, " + - "but got " + (toRawType(inject)) + ".", - vm - ); +function looseIndexOf (arr, val) { + for (var i = 0; i < arr.length; i++) { + if (looseEqual(arr[i], val)) { return i } } + return -1 } /** - * Normalize raw function directives into object format. + * Ensure a function is called only once. */ -function normalizeDirectives (options) { - var dirs = options.directives; - if (dirs) { - for (var key in dirs) { - var def$$1 = dirs[key]; - if (typeof def$$1 === 'function') { - dirs[key] = { bind: def$$1, update: def$$1 }; - } +function once (fn) { + var called = false; + return function () { + if (!called) { + called = true; + fn.apply(this, arguments); } } } -function assertObjectType (name, value, vm) { - if (!isPlainObject(value)) { - warn( - "Invalid value for option \"" + name + "\": expected an Object, " + - "but got " + (toRawType(value)) + ".", - vm - ); - } -} +var ASSET_TYPES = [ + 'component', + 'directive', + 'filter' +]; -/** - * Merge two option objects into a new one. - * Core utility used in both instantiation and inheritance. - */ -function mergeOptions ( - parent, - child, - vm -) { - if (true) { - checkComponents(child); - } +var LIFECYCLE_HOOKS = [ + 'beforeCreate', + 'created', + 'beforeMount', + 'mounted', + 'beforeUpdate', + 'updated', + 'beforeDestroy', + 'destroyed', + 'activated', + 'deactivated', + 'errorCaptured', + 'serverPrefetch' +]; - if (typeof child === 'function') { - child = child.options; - } +/* */ - normalizeProps(child, vm); - normalizeInject(child, vm); - normalizeDirectives(child); - // Apply extends and mixins on the child options, - // but only if it is a raw options object that isn't - // the result of another mergeOptions call. - // Only merged options has the _base property. - if (!child._base) { - if (child.extends) { - parent = mergeOptions(parent, child.extends, vm); - } - if (child.mixins) { - for (var i = 0, l = child.mixins.length; i < l; i++) { - parent = mergeOptions(parent, child.mixins[i], vm); - } - } - } - var options = {}; - var key; - for (key in parent) { - mergeField(key); - } - for (key in child) { - if (!hasOwn(parent, key)) { - mergeField(key); - } - } - function mergeField (key) { - var strat = strats[key] || defaultStrat; - options[key] = strat(parent[key], child[key], vm, key); - } - return options +var config = ({ + /** + * Option merge strategies (used in core/util/options) + */ + // $flow-disable-line + optionMergeStrategies: Object.create(null), + + /** + * Whether to suppress warnings. + */ + silent: false, + + /** + * Show production mode tip message on boot? + */ + productionTip: "development" !== 'production', + + /** + * Whether to enable devtools + */ + devtools: "development" !== 'production', + + /** + * Whether to record perf + */ + performance: false, + + /** + * Error handler for watcher errors + */ + errorHandler: null, + + /** + * Warn handler for watcher warns + */ + warnHandler: null, + + /** + * Ignore certain custom elements + */ + ignoredElements: [], + + /** + * Custom user key aliases for v-on + */ + // $flow-disable-line + keyCodes: Object.create(null), + + /** + * Check if a tag is reserved so that it cannot be registered as a + * component. This is platform-dependent and may be overwritten. + */ + isReservedTag: no, + + /** + * Check if an attribute is reserved so that it cannot be used as a component + * prop. This is platform-dependent and may be overwritten. + */ + isReservedAttr: no, + + /** + * Check if a tag is an unknown element. + * Platform-dependent. + */ + isUnknownElement: no, + + /** + * Get the namespace of an element + */ + getTagNamespace: noop, + + /** + * Parse the real tag name for the specific platform. + */ + parsePlatformTagName: identity, + + /** + * Check if an attribute must be bound using property, e.g. value + * Platform-dependent. + */ + mustUseProp: no, + + /** + * Perform updates asynchronously. Intended to be used by Vue Test Utils + * This will significantly reduce performance if set to false. + */ + async: true, + + /** + * Exposed for legacy reasons + */ + _lifecycleHooks: LIFECYCLE_HOOKS +}); + +/* */ + +/** + * unicode letters used for parsing html tags, component names and property paths. + * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname + * skipping \u10000-\uEFFFF due to it freezing up PhantomJS + */ +var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; + +/** + * Check if a string starts with $ or _ + */ +function isReserved (str) { + var c = (str + '').charCodeAt(0); + return c === 0x24 || c === 0x5F } /** - * Resolve an asset. - * This function is used because child instances need access - * to assets defined in its ancestor chain. + * Define a property. */ -function resolveAsset ( - options, - type, - id, - warnMissing -) { - /* istanbul ignore if */ - if (typeof id !== 'string') { +function def (obj, key, val, enumerable) { + Object.defineProperty(obj, key, { + value: val, + enumerable: !!enumerable, + writable: true, + configurable: true + }); +} + +/** + * Parse simple path. + */ +var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); +function parsePath (path) { + if (bailRE.test(path)) { return } - var assets = options[type]; - // check local registration variations first - if (hasOwn(assets, id)) { return assets[id] } - var camelizedId = camelize(id); - if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } - var PascalCaseId = capitalize(camelizedId); - if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } - // fallback to prototype chain - var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; - if ( true && warnMissing && !res) { - warn( - 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, - options - ); + var segments = path.split('.'); + return function (obj) { + for (var i = 0; i < segments.length; i++) { + if (!obj) { return } + obj = obj[segments[i]]; + } + return obj } - return res } /* */ +// can we use __proto__? +var hasProto = '__proto__' in {}; +// Browser environment sniffing +var inBrowser = typeof window !== 'undefined'; +var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; +var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); +var UA = inBrowser && window.navigator.userAgent.toLowerCase(); +var isIE = UA && /msie|trident/.test(UA); +var isIE9 = UA && UA.indexOf('msie 9.0') > 0; +var isEdge = UA && UA.indexOf('edge/') > 0; +var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); +var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); +var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; +var isPhantomJS = UA && /phantomjs/.test(UA); +var isFF = UA && UA.match(/firefox\/(\d+)/); -function validateProp ( - key, - propOptions, - propsData, - vm -) { - var prop = propOptions[key]; - var absent = !hasOwn(propsData, key); - var value = propsData[key]; - // boolean casting - var booleanIndex = getTypeIndex(Boolean, prop.type); - if (booleanIndex > -1) { - if (absent && !hasOwn(prop, 'default')) { - value = false; - } else if (value === '' || value === hyphenate(key)) { - // only cast empty string / same name to boolean if - // boolean has higher priority - var stringIndex = getTypeIndex(String, prop.type); - if (stringIndex < 0 || booleanIndex < stringIndex) { - value = true; +// Firefox has a "watch" function on Object.prototype... +var nativeWatch = ({}).watch; +if (inBrowser) { + try { + var opts = {}; + Object.defineProperty(opts, 'passive', ({ + get: function get () { } + })); // https://github.com/facebook/flow/issues/285 + window.addEventListener('test-passive', null, opts); + } catch (e) {} +} + +// this needs to be lazy-evaled because vue may be required before +// vue-server-renderer can set VUE_ENV +var _isServer; +var isServerRendering = function () { + if (_isServer === undefined) { + /* istanbul ignore if */ + if (!inBrowser && !inWeex && typeof global !== 'undefined') { + // detect presence of vue-server-renderer and avoid + // Webpack shimming the process + _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; + } else { + _isServer = false; } } - // check default value - if (value === undefined) { - value = getPropDefaultValue(vm, prop, key); - // since the default value is a fresh copy, - // make sure to observe it. - var prevShouldObserve = shouldObserve; - toggleObserving(true); - observe(value); - toggleObserving(prevShouldObserve); - } - if ( - true - ) { - assertProp(prop, key, value, vm, absent); - } - return value + return _isServer +}; + +// detect devtools +var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; + +/* istanbul ignore next */ +function isNative (Ctor) { + return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) } -/** - * Get the default value of a prop. - */ -function getPropDefaultValue (vm, prop, key) { - // no default, return undefined - if (!hasOwn(prop, 'default')) { - return undefined - } - var def = prop.default; - // warn against non-factory defaults for Object & Array - if ( true && isObject(def)) { - warn( - 'Invalid default value for prop "' + key + '": ' + - 'Props with type Object/Array must use a factory function ' + - 'to return the default value.', - vm - ); - } - // the raw prop value was also undefined from previous render, - // return previous default value to avoid unnecessary watcher trigger - if (vm && vm.$options.propsData && - vm.$options.propsData[key] === undefined && - vm._props[key] !== undefined - ) { - return vm._props[key] - } - // call factory function for non-Function types - // a value is Function if its prototype is function even across different execution context - return typeof def === 'function' && getType(prop.type) !== 'Function' - ? def.call(vm) - : def +var hasSymbol = + typeof Symbol !== 'undefined' && isNative(Symbol) && + typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); + +var _Set; +/* istanbul ignore if */ // $flow-disable-line +if (typeof Set !== 'undefined' && isNative(Set)) { + // use native Set when available. + _Set = Set; +} else { + // a non-standard Set polyfill that only works with primitive keys. + _Set = /*@__PURE__*/(function () { + function Set () { + this.set = Object.create(null); + } + Set.prototype.has = function has (key) { + return this.set[key] === true + }; + Set.prototype.add = function add (key) { + this.set[key] = true; + }; + Set.prototype.clear = function clear () { + this.set = Object.create(null); + }; + + return Set; + }()); } -/** - * Assert whether a prop is valid. - */ -function assertProp ( - prop, - name, - value, - vm, - absent -) { - if (prop.required && absent) { - warn( - 'Missing required prop: "' + name + '"', - vm - ); - return - } - if (value == null && !prop.required) { - return - } - var type = prop.type; - var valid = !type || type === true; - var expectedTypes = []; - if (type) { - if (!Array.isArray(type)) { - type = [type]; +/* */ + +var warn = noop; +var tip = noop; +var generateComponentTrace = (noop); // work around flow check +var formatComponentName = (noop); + +if (true) { + var hasConsole = typeof console !== 'undefined'; + var classifyRE = /(?:^|[-_])(\w)/g; + var classify = function (str) { return str + .replace(classifyRE, function (c) { return c.toUpperCase(); }) + .replace(/[-_]/g, ''); }; + + warn = function (msg, vm) { + var trace = vm ? generateComponentTrace(vm) : ''; + + if (config.warnHandler) { + config.warnHandler.call(null, msg, vm, trace); + } else if (hasConsole && (!config.silent)) { + console.error(("[Vue warn]: " + msg + trace)); } - for (var i = 0; i < type.length && !valid; i++) { - var assertedType = assertType(value, type[i]); - expectedTypes.push(assertedType.expectedType || ''); - valid = assertedType.valid; + }; + + tip = function (msg, vm) { + if (hasConsole && (!config.silent)) { + console.warn("[Vue tip]: " + msg + ( + vm ? generateComponentTrace(vm) : '' + )); + } + }; + + formatComponentName = function (vm, includeFile) { + if (vm.$root === vm) { + if (vm.$options && vm.$options.__file) { // fixed by xxxxxx + return ('') + vm.$options.__file + } + return '' + } + var options = typeof vm === 'function' && vm.cid != null + ? vm.options + : vm._isVue + ? vm.$options || vm.constructor.options + : vm; + var name = options.name || options._componentTag; + var file = options.__file; + if (!name && file) { + var match = file.match(/([^/\\]+)\.vue$/); + name = match && match[1]; + } + + return ( + (name ? ("<" + (classify(name)) + ">") : "") + + (file && includeFile !== false ? (" at " + file) : '') + ) + }; + + var repeat = function (str, n) { + var res = ''; + while (n) { + if (n % 2 === 1) { res += str; } + if (n > 1) { str += str; } + n >>= 1; } - } + return res + }; - if (!valid) { - warn( - getInvalidTypeMessage(name, value, expectedTypes), - vm - ); - return - } - var validator = prop.validator; - if (validator) { - if (!validator(value)) { - warn( - 'Invalid prop: custom validator check failed for prop "' + name + '".', - vm - ); + generateComponentTrace = function (vm) { + if (vm._isVue && vm.$parent) { + var tree = []; + var currentRecursiveSequence = 0; + while (vm && vm.$options.name !== 'PageBody') { + if (tree.length > 0) { + var last = tree[tree.length - 1]; + if (last.constructor === vm.constructor) { + currentRecursiveSequence++; + vm = vm.$parent; + continue + } else if (currentRecursiveSequence > 0) { + tree[tree.length - 1] = [last, currentRecursiveSequence]; + currentRecursiveSequence = 0; + } + } + !vm.$options.isReserved && tree.push(vm); + vm = vm.$parent; + } + return '\n\nfound in\n\n' + tree + .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) + ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") + : formatComponentName(vm))); }) + .join('\n') + } else { + return ("\n\n(found in " + (formatComponentName(vm)) + ")") } - } + }; } -var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; +/* */ -function assertType (value, type) { - var valid; - var expectedType = getType(type); - if (simpleCheckRE.test(expectedType)) { - var t = typeof value; - valid = t === expectedType.toLowerCase(); - // for primitive wrapper objects - if (!valid && t === 'object') { - valid = value instanceof type; - } - } else if (expectedType === 'Object') { - valid = isPlainObject(value); - } else if (expectedType === 'Array') { - valid = Array.isArray(value); - } else { - valid = value instanceof type; - } - return { - valid: valid, - expectedType: expectedType - } -} +var uid = 0; /** - * Use function string name to check built-in types, - * because a simple equality check will fail when running - * across different vms / iframes. + * A dep is an observable that can have multiple + * directives subscribing to it. */ -function getType (fn) { - var match = fn && fn.toString().match(/^\s*function (\w+)/); - return match ? match[1] : '' -} +var Dep = function Dep () { + this.id = uid++; + this.subs = []; +}; -function isSameType (a, b) { - return getType(a) === getType(b) -} +Dep.prototype.addSub = function addSub (sub) { + this.subs.push(sub); +}; -function getTypeIndex (type, expectedTypes) { - if (!Array.isArray(expectedTypes)) { - return isSameType(expectedTypes, type) ? 0 : -1 - } - for (var i = 0, len = expectedTypes.length; i < len; i++) { - if (isSameType(expectedTypes[i], type)) { - return i - } +Dep.prototype.removeSub = function removeSub (sub) { + remove(this.subs, sub); +}; + +Dep.prototype.depend = function depend () { + if (Dep.SharedObject.target) { + Dep.SharedObject.target.addDep(this); } - return -1 -} +}; -function getInvalidTypeMessage (name, value, expectedTypes) { - var message = "Invalid prop: type check failed for prop \"" + name + "\"." + - " Expected " + (expectedTypes.map(capitalize).join(', ')); - var expectedType = expectedTypes[0]; - var receivedType = toRawType(value); - var expectedValue = styleValue(value, expectedType); - var receivedValue = styleValue(value, receivedType); - // check if we need to specify expected value - if (expectedTypes.length === 1 && - isExplicable(expectedType) && - !isBoolean(expectedType, receivedType)) { - message += " with value " + expectedValue; +Dep.prototype.notify = function notify () { + // stabilize the subscriber list first + var subs = this.subs.slice(); + if ( true && !config.async) { + // subs aren't sorted in scheduler if not running async + // we need to sort them now to make sure they fire in correct + // order + subs.sort(function (a, b) { return a.id - b.id; }); } - message += ", got " + receivedType + " "; - // check if we need to specify received value - if (isExplicable(receivedType)) { - message += "with value " + receivedValue + "."; + for (var i = 0, l = subs.length; i < l; i++) { + subs[i].update(); } - return message -} +}; -function styleValue (value, type) { - if (type === 'String') { - return ("\"" + value + "\"") - } else if (type === 'Number') { - return ("" + (Number(value))) - } else { - return ("" + value) - } -} +// The current target watcher being evaluated. +// This is globally unique because only one watcher +// can be evaluated at a time. +// fixed by xxxxxx (nvue shared vuex) +/* eslint-disable no-undef */ +Dep.SharedObject = {}; +Dep.SharedObject.target = null; +Dep.SharedObject.targetStack = []; -function isExplicable (value) { - var explicitTypes = ['string', 'number', 'boolean']; - return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; }) +function pushTarget (target) { + Dep.SharedObject.targetStack.push(target); + Dep.SharedObject.target = target; + Dep.target = target; } -function isBoolean () { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - - return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) +function popTarget () { + Dep.SharedObject.targetStack.pop(); + Dep.SharedObject.target = Dep.SharedObject.targetStack[Dep.SharedObject.targetStack.length - 1]; + Dep.target = Dep.SharedObject.target; } /* */ -function handleError (err, vm, info) { - // Deactivate deps tracking while processing error handler to avoid possible infinite rendering. - // See: https://github.com/vuejs/vuex/issues/1505 - pushTarget(); - try { - if (vm) { - var cur = vm; - while ((cur = cur.$parent)) { - var hooks = cur.$options.errorCaptured; - if (hooks) { - for (var i = 0; i < hooks.length; i++) { - try { - var capture = hooks[i].call(cur, err, vm, info) === false; - if (capture) { return } - } catch (e) { - globalHandleError(e, cur, 'errorCaptured hook'); - } - } - } - } - } - globalHandleError(err, vm, info); - } finally { - popTarget(); - } -} - -function invokeWithErrorHandling ( - handler, +var VNode = function VNode ( + tag, + data, + children, + text, + elm, context, - args, - vm, - info + componentOptions, + asyncFactory ) { - var res; - try { - res = args ? handler.apply(context, args) : handler.call(context); - if (res && !res._isVue && isPromise(res) && !res._handled) { - res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); }); - // issue #9511 - // avoid catch triggering multiple times when nested calls - res._handled = true; - } - } catch (e) { - handleError(e, vm, info); - } - return res -} + this.tag = tag; + this.data = data; + this.children = children; + this.text = text; + this.elm = elm; + this.ns = undefined; + this.context = context; + this.fnContext = undefined; + this.fnOptions = undefined; + this.fnScopeId = undefined; + this.key = data && data.key; + this.componentOptions = componentOptions; + this.componentInstance = undefined; + this.parent = undefined; + this.raw = false; + this.isStatic = false; + this.isRootInsert = true; + this.isComment = false; + this.isCloned = false; + this.isOnce = false; + this.asyncFactory = asyncFactory; + this.asyncMeta = undefined; + this.isAsyncPlaceholder = false; +}; + +var prototypeAccessors = { child: { configurable: true } }; + +// DEPRECATED: alias for componentInstance for backwards compat. +/* istanbul ignore next */ +prototypeAccessors.child.get = function () { + return this.componentInstance +}; -function globalHandleError (err, vm, info) { - if (config.errorHandler) { - try { - return config.errorHandler.call(null, err, vm, info) - } catch (e) { - // if the user intentionally throws the original error in the handler, - // do not log it twice - if (e !== err) { - logError(e, null, 'config.errorHandler'); - } - } - } - logError(err, vm, info); +Object.defineProperties( VNode.prototype, prototypeAccessors ); + +var createEmptyVNode = function (text) { + if ( text === void 0 ) text = ''; + + var node = new VNode(); + node.text = text; + node.isComment = true; + return node +}; + +function createTextVNode (val) { + return new VNode(undefined, undefined, undefined, String(val)) } -function logError (err, vm, info) { - if (true) { - warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); - } - /* istanbul ignore else */ - if ((inBrowser || inWeex) && typeof console !== 'undefined') { - console.error(err); - } else { - throw err - } +// optimized shallow clone +// used for static nodes and slot nodes because they may be reused across +// multiple renders, cloning them avoids errors when DOM manipulations rely +// on their elm reference. +function cloneVNode (vnode) { + var cloned = new VNode( + vnode.tag, + vnode.data, + // #7975 + // clone children array to avoid mutating original in case of cloning + // a child. + vnode.children && vnode.children.slice(), + vnode.text, + vnode.elm, + vnode.context, + vnode.componentOptions, + vnode.asyncFactory + ); + cloned.ns = vnode.ns; + cloned.isStatic = vnode.isStatic; + cloned.key = vnode.key; + cloned.isComment = vnode.isComment; + cloned.fnContext = vnode.fnContext; + cloned.fnOptions = vnode.fnOptions; + cloned.fnScopeId = vnode.fnScopeId; + cloned.asyncMeta = vnode.asyncMeta; + cloned.isCloned = true; + return cloned } -/* */ +/* + * not type checking this file because flow doesn't play well with + * dynamically accessing methods on Array prototype + */ -var callbacks = []; -var pending = false; +var arrayProto = Array.prototype; +var arrayMethods = Object.create(arrayProto); -function flushCallbacks () { - pending = false; - var copies = callbacks.slice(0); - callbacks.length = 0; - for (var i = 0; i < copies.length; i++) { - copies[i](); - } -} +var methodsToPatch = [ + 'push', + 'pop', + 'shift', + 'unshift', + 'splice', + 'sort', + 'reverse' +]; -// Here we have async deferring wrappers using microtasks. -// In 2.5 we used (macro) tasks (in combination with microtasks). -// However, it has subtle problems when state is changed right before repaint -// (e.g. #6813, out-in transitions). -// Also, using (macro) tasks in event handler would cause some weird behaviors -// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109). -// So we now use microtasks everywhere, again. -// A major drawback of this tradeoff is that there are some scenarios -// where microtasks have too high a priority and fire in between supposedly -// sequential events (e.g. #4521, #6690, which have workarounds) -// or even between bubbling of the same event (#6566). -var timerFunc; +/** + * Intercept mutating methods and emit events + */ +methodsToPatch.forEach(function (method) { + // cache original method + var original = arrayProto[method]; + def(arrayMethods, method, function mutator () { + var args = [], len = arguments.length; + while ( len-- ) args[ len ] = arguments[ len ]; -// The nextTick behavior leverages the microtask queue, which can be accessed -// via either native Promise.then or MutationObserver. -// MutationObserver has wider support, however it is seriously bugged in -// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It -// completely stops working after triggering a few times... so, if native -// Promise is available, we will use it: -/* istanbul ignore next, $flow-disable-line */ -if (typeof Promise !== 'undefined' && isNative(Promise)) { - var p = Promise.resolve(); - timerFunc = function () { - p.then(flushCallbacks); - // In problematic UIWebViews, Promise.then doesn't completely break, but - // it can get stuck in a weird state where callbacks are pushed into the - // microtask queue but the queue isn't being flushed, until the browser - // needs to do some other work, e.g. handle a timer. Therefore we can - // "force" the microtask queue to be flushed by adding an empty timer. - if (isIOS) { setTimeout(noop); } - }; -} else if (!isIE && typeof MutationObserver !== 'undefined' && ( - isNative(MutationObserver) || - // PhantomJS and iOS 7.x - MutationObserver.toString() === '[object MutationObserverConstructor]' -)) { - // Use MutationObserver where native Promise is not available, - // e.g. PhantomJS, iOS7, Android 4.4 - // (#6466 MutationObserver is unreliable in IE11) - var counter = 1; - var observer = new MutationObserver(flushCallbacks); - var textNode = document.createTextNode(String(counter)); - observer.observe(textNode, { - characterData: true + var result = original.apply(this, args); + var ob = this.__ob__; + var inserted; + switch (method) { + case 'push': + case 'unshift': + inserted = args; + break + case 'splice': + inserted = args.slice(2); + break + } + if (inserted) { ob.observeArray(inserted); } + // notify change + ob.dep.notify(); + return result }); - timerFunc = function () { - counter = (counter + 1) % 2; - textNode.data = String(counter); - }; -} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { - // Fallback to setImmediate. - // Technically it leverages the (macro) task queue, - // but it is still a better choice than setTimeout. - timerFunc = function () { - setImmediate(flushCallbacks); - }; -} else { - // Fallback to setTimeout. - timerFunc = function () { - setTimeout(flushCallbacks, 0); - }; +}); + +/* */ + +var arrayKeys = Object.getOwnPropertyNames(arrayMethods); + +/** + * In some cases we may want to disable observation inside a component's + * update computation. + */ +var shouldObserve = true; + +function toggleObserving (value) { + shouldObserve = value; } -function nextTick (cb, ctx) { - var _resolve; - callbacks.push(function () { - if (cb) { - try { - cb.call(ctx); - } catch (e) { - handleError(e, ctx, 'nextTick'); +/** + * Observer class that is attached to each observed + * object. Once attached, the observer converts the target + * object's property keys into getter/setters that + * collect dependencies and dispatch updates. + */ +var Observer = function Observer (value) { + this.value = value; + this.dep = new Dep(); + this.vmCount = 0; + def(value, '__ob__', this); + if (Array.isArray(value)) { + if (hasProto) { + {// fixed by xxxxxx 微信小程序使用 plugins 之后,数组方法被直接挂载到了数组对象上,需要执行 copyAugment 逻辑 + if(value.push !== value.__proto__.push){ + copyAugment(value, arrayMethods, arrayKeys); + } else { + protoAugment(value, arrayMethods); + } } - } else if (_resolve) { - _resolve(ctx); + } else { + copyAugment(value, arrayMethods, arrayKeys); } - }); - if (!pending) { - pending = true; - timerFunc(); + this.observeArray(value); + } else { + this.walk(value); } - // $flow-disable-line - if (!cb && typeof Promise !== 'undefined') { - return new Promise(function (resolve) { - _resolve = resolve; - }) +}; + +/** + * Walk through all properties and convert them into + * getter/setters. This method should only be called when + * value type is Object. + */ +Observer.prototype.walk = function walk (obj) { + var keys = Object.keys(obj); + for (var i = 0; i < keys.length; i++) { + defineReactive$$1(obj, keys[i]); } -} +}; -/* */ +/** + * Observe a list of Array items. + */ +Observer.prototype.observeArray = function observeArray (items) { + for (var i = 0, l = items.length; i < l; i++) { + observe(items[i]); + } +}; + +// helpers -/* not type checking this file because flow doesn't play well with Proxy */ +/** + * Augment a target Object or Array by intercepting + * the prototype chain using __proto__ + */ +function protoAugment (target, src) { + /* eslint-disable no-proto */ + target.__proto__ = src; + /* eslint-enable no-proto */ +} -var initProxy; +/** + * Augment a target Object or Array by defining + * hidden properties. + */ +/* istanbul ignore next */ +function copyAugment (target, src, keys) { + for (var i = 0, l = keys.length; i < l; i++) { + var key = keys[i]; + def(target, key, src[key]); + } +} -if (true) { - var allowedGlobals = makeMap( - 'Infinity,undefined,NaN,isFinite,isNaN,' + - 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + - 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + - 'require' // for Webpack/Browserify - ); +/** + * Attempt to create an observer instance for a value, + * returns the new observer if successfully observed, + * or the existing observer if the value already has one. + */ +function observe (value, asRootData) { + if (!isObject(value) || value instanceof VNode) { + return + } + var ob; + if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { + ob = value.__ob__; + } else if ( + shouldObserve && + !isServerRendering() && + (Array.isArray(value) || isPlainObject(value)) && + Object.isExtensible(value) && + !value._isVue + ) { + ob = new Observer(value); + } + if (asRootData && ob) { + ob.vmCount++; + } + return ob +} - var warnNonPresent = function (target, key) { - warn( - "Property or method \"" + key + "\" is not defined on the instance but " + - 'referenced during render. Make sure that this property is reactive, ' + - 'either in the data option, or for class-based components, by ' + - 'initializing the property. ' + - 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', - target - ); - }; +/** + * Define a reactive property on an Object. + */ +function defineReactive$$1 ( + obj, + key, + val, + customSetter, + shallow +) { + var dep = new Dep(); - var warnReservedPrefix = function (target, key) { - warn( - "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + - 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + - 'prevent conflicts with Vue internals. ' + - 'See: https://vuejs.org/v2/api/#data', - target - ); - }; + var property = Object.getOwnPropertyDescriptor(obj, key); + if (property && property.configurable === false) { + return + } - var hasProxy = - typeof Proxy !== 'undefined' && isNative(Proxy); + // cater for pre-defined getter/setters + var getter = property && property.get; + var setter = property && property.set; + if ((!getter || setter) && arguments.length === 2) { + val = obj[key]; + } - if (hasProxy) { - var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); - config.keyCodes = new Proxy(config.keyCodes, { - set: function set (target, key, value) { - if (isBuiltInModifier(key)) { - warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); - return false - } else { - target[key] = value; - return true + var childOb = !shallow && observe(val); + Object.defineProperty(obj, key, { + enumerable: true, + configurable: true, + get: function reactiveGetter () { + var value = getter ? getter.call(obj) : val; + if (Dep.SharedObject.target) { // fixed by xxxxxx + dep.depend(); + if (childOb) { + childOb.dep.depend(); + if (Array.isArray(value)) { + dependArray(value); + } } } - }); - } - - var hasHandler = { - has: function has (target, key) { - var has = key in target; - var isAllowed = allowedGlobals(key) || - (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); - if (!has && !isAllowed) { - if (key in target.$data) { warnReservedPrefix(target, key); } - else { warnNonPresent(target, key); } + return value + }, + set: function reactiveSetter (newVal) { + var value = getter ? getter.call(obj) : val; + /* eslint-disable no-self-compare */ + if (newVal === value || (newVal !== newVal && value !== value)) { + return } - return has || !isAllowed - } - }; - - var getHandler = { - get: function get (target, key) { - if (typeof key === 'string' && !(key in target)) { - if (key in target.$data) { warnReservedPrefix(target, key); } - else { warnNonPresent(target, key); } + /* eslint-enable no-self-compare */ + if ( true && customSetter) { + customSetter(); } - return target[key] - } - }; - - initProxy = function initProxy (vm) { - if (hasProxy) { - // determine which proxy handler to use - var options = vm.$options; - var handlers = options.render && options.render._withStripped - ? getHandler - : hasHandler; - vm._renderProxy = new Proxy(vm, handlers); - } else { - vm._renderProxy = vm; + // #7981: for accessor properties without setter + if (getter && !setter) { return } + if (setter) { + setter.call(obj, newVal); + } else { + val = newVal; + } + childOb = !shallow && observe(newVal); + dep.notify(); } - }; + }); } -/* */ - -var seenObjects = new _Set(); - /** - * Recursively traverse an object to evoke all converted - * getters, so that every nested property inside the object - * is collected as a "deep" dependency. + * Set a property on an object. Adds the new property and + * triggers change notification if the property doesn't + * already exist. */ -function traverse (val) { - _traverse(val, seenObjects); - seenObjects.clear(); +function set (target, key, val) { + if ( true && + (isUndef(target) || isPrimitive(target)) + ) { + warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.length = Math.max(target.length, key); + target.splice(key, 1, val); + return val + } + if (key in target && !(key in Object.prototype)) { + target[key] = val; + return val + } + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + true && warn( + 'Avoid adding reactive properties to a Vue instance or its root $data ' + + 'at runtime - declare it upfront in the data option.' + ); + return val + } + if (!ob) { + target[key] = val; + return val + } + defineReactive$$1(ob.value, key, val); + ob.dep.notify(); + return val } -function _traverse (val, seen) { - var i, keys; - var isA = Array.isArray(val); - if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { +/** + * Delete a property and trigger change if necessary. + */ +function del (target, key) { + if ( true && + (isUndef(target) || isPrimitive(target)) + ) { + warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); + } + if (Array.isArray(target) && isValidArrayIndex(key)) { + target.splice(key, 1); return } - if (val.__ob__) { - var depId = val.__ob__.dep.id; - if (seen.has(depId)) { - return - } - seen.add(depId); + var ob = (target).__ob__; + if (target._isVue || (ob && ob.vmCount)) { + true && warn( + 'Avoid deleting properties on a Vue instance or its root $data ' + + '- just set it to null.' + ); + return } - if (isA) { - i = val.length; - while (i--) { _traverse(val[i], seen); } - } else { - keys = Object.keys(val); - i = keys.length; - while (i--) { _traverse(val[keys[i]], seen); } + if (!hasOwn(target, key)) { + return + } + delete target[key]; + if (!ob) { + return } + ob.dep.notify(); } -var mark; -var measure; - -if (true) { - var perf = inBrowser && window.performance; - /* istanbul ignore if */ - if ( - perf && - perf.mark && - perf.measure && - perf.clearMarks && - perf.clearMeasures - ) { - mark = function (tag) { return perf.mark(tag); }; - measure = function (name, startTag, endTag) { - perf.measure(name, startTag, endTag); - perf.clearMarks(startTag); - perf.clearMarks(endTag); - // perf.clearMeasures(name) - }; +/** + * Collect dependencies on array elements when the array is touched, since + * we cannot intercept array element access like property getters. + */ +function dependArray (value) { + for (var e = (void 0), i = 0, l = value.length; i < l; i++) { + e = value[i]; + e && e.__ob__ && e.__ob__.dep.depend(); + if (Array.isArray(e)) { + dependArray(e); + } } } /* */ -var normalizeEvent = cached(function (name) { - var passive = name.charAt(0) === '&'; - name = passive ? name.slice(1) : name; - var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first - name = once$$1 ? name.slice(1) : name; - var capture = name.charAt(0) === '!'; - name = capture ? name.slice(1) : name; - return { - name: name, - once: once$$1, - capture: capture, - passive: passive - } -}); - -function createFnInvoker (fns, vm) { - function invoker () { - var arguments$1 = arguments; - - var fns = invoker.fns; - if (Array.isArray(fns)) { - var cloned = fns.slice(); - for (var i = 0; i < cloned.length; i++) { - invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler"); - } - } else { - // return handler return value for single handlers - return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler") - } - } - invoker.fns = fns; - return invoker -} +/** + * Option overwriting strategies are functions that handle + * how to merge a parent option value and a child option + * value into the final value. + */ +var strats = config.optionMergeStrategies; -function updateListeners ( - on, - oldOn, - add, - remove$$1, - createOnceHandler, - vm -) { - var name, def$$1, cur, old, event; - for (name in on) { - def$$1 = cur = on[name]; - old = oldOn[name]; - event = normalizeEvent(name); - if (isUndef(cur)) { - true && warn( - "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), - vm +/** + * Options with restrictions + */ +if (true) { + strats.el = strats.propsData = function (parent, child, vm, key) { + if (!vm) { + warn( + "option \"" + key + "\" can only be used during instance " + + 'creation with the `new` keyword.' ); - } else if (isUndef(old)) { - if (isUndef(cur.fns)) { - cur = on[name] = createFnInvoker(cur, vm); - } - if (isTrue(event.once)) { - cur = on[name] = createOnceHandler(event.name, cur, event.capture); - } - add(event.name, cur, event.capture, event.passive, event.params); - } else if (cur !== old) { - old.fns = cur; - on[name] = old; - } - } - for (name in oldOn) { - if (isUndef(on[name])) { - event = normalizeEvent(name); - remove$$1(event.name, oldOn[name], event.capture); } - } + return defaultStrat(parent, child) + }; } -/* */ +/** + * Helper that recursively merges two data objects together. + */ +function mergeData (to, from) { + if (!from) { return to } + var key, toVal, fromVal; -/* */ + var keys = hasSymbol + ? Reflect.ownKeys(from) + : Object.keys(from); -// fixed by xxxxxx (mp properties) -function extractPropertiesFromVNodeData(data, Ctor, res, context) { - var propOptions = Ctor.options.mpOptions && Ctor.options.mpOptions.properties; - if (isUndef(propOptions)) { - return res - } - var externalClasses = Ctor.options.mpOptions.externalClasses || []; - var attrs = data.attrs; - var props = data.props; - if (isDef(attrs) || isDef(props)) { - for (var key in propOptions) { - var altKey = hyphenate(key); - var result = checkProp(res, props, key, altKey, true) || - checkProp(res, attrs, key, altKey, false); - // externalClass - if ( - result && - res[key] && - externalClasses.indexOf(altKey) !== -1 && - context[camelize(res[key])] - ) { - // 赋值 externalClass 真正的值(模板里 externalClass 的值可能是字符串) - res[key] = context[camelize(res[key])]; - } + for (var i = 0; i < keys.length; i++) { + key = keys[i]; + // in case the object is already observed... + if (key === '__ob__') { continue } + toVal = to[key]; + fromVal = from[key]; + if (!hasOwn(to, key)) { + set(to, key, fromVal); + } else if ( + toVal !== fromVal && + isPlainObject(toVal) && + isPlainObject(fromVal) + ) { + mergeData(toVal, fromVal); } } - return res + return to } -function extractPropsFromVNodeData ( - data, - Ctor, - tag, - context// fixed by xxxxxx +/** + * Data + */ +function mergeDataOrFn ( + parentVal, + childVal, + vm ) { - // we are only extracting raw values here. - // validation and default values are handled in the child - // component itself. - var propOptions = Ctor.options.props; - if (isUndef(propOptions)) { - // fixed by xxxxxx - return extractPropertiesFromVNodeData(data, Ctor, {}, context) - } - var res = {}; - var attrs = data.attrs; - var props = data.props; - if (isDef(attrs) || isDef(props)) { - for (var key in propOptions) { - var altKey = hyphenate(key); - if (true) { - var keyInLowerCase = key.toLowerCase(); - if ( - key !== keyInLowerCase && - attrs && hasOwn(attrs, keyInLowerCase) - ) { - tip( - "Prop \"" + keyInLowerCase + "\" is passed to component " + - (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + - " \"" + key + "\". " + - "Note that HTML attributes are case-insensitive and camelCased " + - "props need to use their kebab-case equivalents when using in-DOM " + - "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." - ); - } - } - checkProp(res, props, key, altKey, true) || - checkProp(res, attrs, key, altKey, false); + if (!vm) { + // in a Vue.extend merge, both should be functions + if (!childVal) { + return parentVal } - } - // fixed by xxxxxx - return extractPropertiesFromVNodeData(data, Ctor, res, context) -} - -function checkProp ( - res, - hash, - key, - altKey, - preserve -) { - if (isDef(hash)) { - if (hasOwn(hash, key)) { - res[key] = hash[key]; - if (!preserve) { - delete hash[key]; - } - return true - } else if (hasOwn(hash, altKey)) { - res[key] = hash[altKey]; - if (!preserve) { - delete hash[altKey]; + if (!parentVal) { + return childVal + } + // when parentVal & childVal are both present, + // we need to return a function that returns the + // merged result of both functions... no need to + // check if parentVal is a function here because + // it has to be a function to pass previous merges. + return function mergedDataFn () { + return mergeData( + typeof childVal === 'function' ? childVal.call(this, this) : childVal, + typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal + ) + } + } else { + return function mergedInstanceDataFn () { + // instance merge + var instanceData = typeof childVal === 'function' + ? childVal.call(vm, vm) + : childVal; + var defaultData = typeof parentVal === 'function' + ? parentVal.call(vm, vm) + : parentVal; + if (instanceData) { + return mergeData(instanceData, defaultData) + } else { + return defaultData } - return true } } - return false } -/* */ - -// The template compiler attempts to minimize the need for normalization by -// statically analyzing the template at compile time. -// -// For plain HTML markup, normalization can be completely skipped because the -// generated render function is guaranteed to return Array. There are -// two cases where extra normalization is needed: +strats.data = function ( + parentVal, + childVal, + vm +) { + if (!vm) { + if (childVal && typeof childVal !== 'function') { + true && warn( + 'The "data" option should be a function ' + + 'that returns a per-instance value in component ' + + 'definitions.', + vm + ); -// 1. When the children contains components - because a functional component -// may return an Array instead of a single root. In this case, just a simple -// normalization is needed - if any child is an Array, we flatten the whole -// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep -// because functional components already normalize their own children. -function simpleNormalizeChildren (children) { - for (var i = 0; i < children.length; i++) { - if (Array.isArray(children[i])) { - return Array.prototype.concat.apply([], children) + return parentVal } + return mergeDataOrFn(parentVal, childVal) } - return children -} -// 2. When the children contains constructs that always generated nested Arrays, -// e.g.