提交 0a51a642 编写于 作者: Q qiang

build runtime

上级 ba66d7d1
...@@ -470,10 +470,6 @@ TODOS.forEach(function (name) { ...@@ -470,10 +470,6 @@ TODOS.forEach(function (name) {
}); });
const getEmitter = (function () { const getEmitter = (function () {
if (typeof getUniEmitter === 'function') {
/* eslint-disable no-undef */
return getUniEmitter
}
let Emitter; let Emitter;
return function getUniEmitter () { return function getUniEmitter () {
if (!Emitter) { if (!Emitter) {
...@@ -637,8 +633,8 @@ Component = function (options = {}) { ...@@ -637,8 +633,8 @@ Component = function (options = {}) {
const PAGE_EVENT_HOOKS = [ const PAGE_EVENT_HOOKS = [
'onPullDownRefresh', 'onPullDownRefresh',
'onReachBottom', 'onReachBottom',
'onAddToFavorites', 'onAddToFavorites',
'onShareTimeline', 'onShareTimeline',
'onShareAppMessage', 'onShareAppMessage',
'onPageScroll', 'onPageScroll',
...@@ -1073,6 +1069,15 @@ function isMatchEventType (eventType, optType) { ...@@ -1073,6 +1069,15 @@ function isMatchEventType (eventType, optType) {
) )
} }
function getContextVm (vm) {
let $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent
}
function handleEvent (event) { function handleEvent (event) {
event = wrapper$2(event); event = wrapper$2(event);
...@@ -1105,12 +1110,8 @@ function handleEvent (event) { ...@@ -1105,12 +1110,8 @@ function handleEvent (event) {
const methodName = eventArray[0]; const methodName = eventArray[0];
if (methodName) { if (methodName) {
let handlerCtx = this.$vm; let handlerCtx = this.$vm;
if ( if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx.$options.generic && handlerCtx = getContextVm(handlerCtx) || handlerCtx;
handlerCtx.$parent &&
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
......
...@@ -972,10 +972,6 @@ var extraApi = /*#__PURE__*/Object.freeze({ ...@@ -972,10 +972,6 @@ var extraApi = /*#__PURE__*/Object.freeze({
}); });
const getEmitter = (function () { const getEmitter = (function () {
if (typeof getUniEmitter === 'function') {
/* eslint-disable no-undef */
return getUniEmitter
}
let Emitter; let Emitter;
return function getUniEmitter () { return function getUniEmitter () {
if (!Emitter) { if (!Emitter) {
...@@ -1124,8 +1120,8 @@ var api = /*#__PURE__*/Object.freeze({ ...@@ -1124,8 +1120,8 @@ var api = /*#__PURE__*/Object.freeze({
const PAGE_EVENT_HOOKS = [ const PAGE_EVENT_HOOKS = [
'onPullDownRefresh', 'onPullDownRefresh',
'onReachBottom', 'onReachBottom',
'onAddToFavorites', 'onAddToFavorites',
'onShareTimeline', 'onShareTimeline',
'onShareAppMessage', 'onShareAppMessage',
'onPageScroll', 'onPageScroll',
...@@ -1550,6 +1546,15 @@ function isMatchEventType (eventType, optType) { ...@@ -1550,6 +1546,15 @@ function isMatchEventType (eventType, optType) {
) )
} }
function getContextVm (vm) {
let $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent
}
function handleEvent (event) { function handleEvent (event) {
event = wrapper$1(event); event = wrapper$1(event);
...@@ -1582,12 +1587,8 @@ function handleEvent (event) { ...@@ -1582,12 +1587,8 @@ function handleEvent (event) {
const methodName = eventArray[0]; const methodName = eventArray[0];
if (methodName) { if (methodName) {
let handlerCtx = this.$vm; let handlerCtx = this.$vm;
if ( if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx.$options.generic && handlerCtx = getContextVm(handlerCtx) || handlerCtx;
handlerCtx.$parent &&
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
......
...@@ -650,10 +650,6 @@ var extraApi = /*#__PURE__*/Object.freeze({ ...@@ -650,10 +650,6 @@ var extraApi = /*#__PURE__*/Object.freeze({
}); });
const getEmitter = (function () { const getEmitter = (function () {
if (typeof getUniEmitter === 'function') {
/* eslint-disable no-undef */
return getUniEmitter
}
let Emitter; let Emitter;
return function getUniEmitter () { return function getUniEmitter () {
if (!Emitter) { if (!Emitter) {
...@@ -753,8 +749,8 @@ Component = function (options = {}) { ...@@ -753,8 +749,8 @@ Component = function (options = {}) {
const PAGE_EVENT_HOOKS = [ const PAGE_EVENT_HOOKS = [
'onPullDownRefresh', 'onPullDownRefresh',
'onReachBottom', 'onReachBottom',
'onAddToFavorites', 'onAddToFavorites',
'onShareTimeline', 'onShareTimeline',
'onShareAppMessage', 'onShareAppMessage',
'onPageScroll', 'onPageScroll',
...@@ -1215,6 +1211,15 @@ function isMatchEventType (eventType, optType) { ...@@ -1215,6 +1211,15 @@ function isMatchEventType (eventType, optType) {
) )
} }
function getContextVm (vm) {
let $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent
}
function handleEvent (event) { function handleEvent (event) {
event = wrapper$1(event); event = wrapper$1(event);
...@@ -1247,12 +1252,8 @@ function handleEvent (event) { ...@@ -1247,12 +1252,8 @@ function handleEvent (event) {
const methodName = eventArray[0]; const methodName = eventArray[0];
if (methodName) { if (methodName) {
let handlerCtx = this.$vm; let handlerCtx = this.$vm;
if ( if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx.$options.generic && handlerCtx = getContextVm(handlerCtx) || handlerCtx;
handlerCtx.$parent &&
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
......
...@@ -611,10 +611,6 @@ var extraApi = /*#__PURE__*/Object.freeze({ ...@@ -611,10 +611,6 @@ var extraApi = /*#__PURE__*/Object.freeze({
}); });
const getEmitter = (function () { const getEmitter = (function () {
if (typeof getUniEmitter === 'function') {
/* eslint-disable no-undef */
return getUniEmitter
}
let Emitter; let Emitter;
return function getUniEmitter () { return function getUniEmitter () {
if (!Emitter) { if (!Emitter) {
...@@ -695,8 +691,8 @@ Component = function (options = {}) { ...@@ -695,8 +691,8 @@ Component = function (options = {}) {
const PAGE_EVENT_HOOKS = [ const PAGE_EVENT_HOOKS = [
'onPullDownRefresh', 'onPullDownRefresh',
'onReachBottom', 'onReachBottom',
'onAddToFavorites', 'onAddToFavorites',
'onShareTimeline', 'onShareTimeline',
'onShareAppMessage', 'onShareAppMessage',
'onPageScroll', 'onPageScroll',
...@@ -1131,6 +1127,15 @@ function isMatchEventType (eventType, optType) { ...@@ -1131,6 +1127,15 @@ function isMatchEventType (eventType, optType) {
) )
} }
function getContextVm (vm) {
let $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent
}
function handleEvent (event) { function handleEvent (event) {
event = wrapper$1(event); event = wrapper$1(event);
...@@ -1163,12 +1168,8 @@ function handleEvent (event) { ...@@ -1163,12 +1168,8 @@ function handleEvent (event) {
const methodName = eventArray[0]; const methodName = eventArray[0];
if (methodName) { if (methodName) {
let handlerCtx = this.$vm; let handlerCtx = this.$vm;
if ( if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx.$options.generic && handlerCtx = getContextVm(handlerCtx) || handlerCtx;
handlerCtx.$parent &&
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
......
...@@ -703,10 +703,6 @@ var extraApi = /*#__PURE__*/Object.freeze({ ...@@ -703,10 +703,6 @@ var extraApi = /*#__PURE__*/Object.freeze({
}); });
const getEmitter = (function () { const getEmitter = (function () {
if (typeof getUniEmitter === 'function') {
/* eslint-disable no-undef */
return getUniEmitter
}
let Emitter; let Emitter;
return function getUniEmitter () { return function getUniEmitter () {
if (!Emitter) { if (!Emitter) {
...@@ -787,8 +783,8 @@ Component = function (options = {}) { ...@@ -787,8 +783,8 @@ Component = function (options = {}) {
const PAGE_EVENT_HOOKS = [ const PAGE_EVENT_HOOKS = [
'onPullDownRefresh', 'onPullDownRefresh',
'onReachBottom', 'onReachBottom',
'onAddToFavorites', 'onAddToFavorites',
'onShareTimeline', 'onShareTimeline',
'onShareAppMessage', 'onShareAppMessage',
'onPageScroll', 'onPageScroll',
...@@ -1223,6 +1219,15 @@ function isMatchEventType (eventType, optType) { ...@@ -1223,6 +1219,15 @@ function isMatchEventType (eventType, optType) {
) )
} }
function getContextVm (vm) {
let $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent
}
function handleEvent (event) { function handleEvent (event) {
event = wrapper$1(event); event = wrapper$1(event);
...@@ -1255,12 +1260,8 @@ function handleEvent (event) { ...@@ -1255,12 +1260,8 @@ function handleEvent (event) {
const methodName = eventArray[0]; const methodName = eventArray[0];
if (methodName) { if (methodName) {
let handlerCtx = this.$vm; let handlerCtx = this.$vm;
if ( if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx.$options.generic && handlerCtx = getContextVm(handlerCtx) || handlerCtx;
handlerCtx.$parent &&
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
......
...@@ -563,10 +563,6 @@ var extraApi = /*#__PURE__*/Object.freeze({ ...@@ -563,10 +563,6 @@ var extraApi = /*#__PURE__*/Object.freeze({
}); });
const getEmitter = (function () { const getEmitter = (function () {
if (typeof getUniEmitter === 'function') {
/* eslint-disable no-undef */
return getUniEmitter
}
let Emitter; let Emitter;
return function getUniEmitter () { return function getUniEmitter () {
if (!Emitter) { if (!Emitter) {
...@@ -652,8 +648,8 @@ Component = function (options = {}) { ...@@ -652,8 +648,8 @@ Component = function (options = {}) {
const PAGE_EVENT_HOOKS = [ const PAGE_EVENT_HOOKS = [
'onPullDownRefresh', 'onPullDownRefresh',
'onReachBottom', 'onReachBottom',
'onAddToFavorites', 'onAddToFavorites',
'onShareTimeline', 'onShareTimeline',
'onShareAppMessage', 'onShareAppMessage',
'onPageScroll', 'onPageScroll',
...@@ -1088,6 +1084,15 @@ function isMatchEventType (eventType, optType) { ...@@ -1088,6 +1084,15 @@ function isMatchEventType (eventType, optType) {
) )
} }
function getContextVm (vm) {
let $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent
}
function handleEvent (event) { function handleEvent (event) {
event = wrapper$1(event); event = wrapper$1(event);
...@@ -1120,12 +1125,8 @@ function handleEvent (event) { ...@@ -1120,12 +1125,8 @@ function handleEvent (event) {
const methodName = eventArray[0]; const methodName = eventArray[0];
if (methodName) { if (methodName) {
let handlerCtx = this.$vm; let handlerCtx = this.$vm;
if ( if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx.$options.generic && handlerCtx = getContextVm(handlerCtx) || handlerCtx;
handlerCtx.$parent &&
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
......
...@@ -553,10 +553,6 @@ var extraApi = /*#__PURE__*/Object.freeze({ ...@@ -553,10 +553,6 @@ var extraApi = /*#__PURE__*/Object.freeze({
}); });
const getEmitter = (function () { const getEmitter = (function () {
if (typeof getUniEmitter === 'function') {
/* eslint-disable no-undef */
return getUniEmitter
}
let Emitter; let Emitter;
return function getUniEmitter () { return function getUniEmitter () {
if (!Emitter) { if (!Emitter) {
...@@ -637,8 +633,8 @@ Component = function (options = {}) { ...@@ -637,8 +633,8 @@ Component = function (options = {}) {
const PAGE_EVENT_HOOKS = [ const PAGE_EVENT_HOOKS = [
'onPullDownRefresh', 'onPullDownRefresh',
'onReachBottom', 'onReachBottom',
'onAddToFavorites', 'onAddToFavorites',
'onShareTimeline', 'onShareTimeline',
'onShareAppMessage', 'onShareAppMessage',
'onPageScroll', 'onPageScroll',
...@@ -1073,6 +1069,15 @@ function isMatchEventType (eventType, optType) { ...@@ -1073,6 +1069,15 @@ function isMatchEventType (eventType, optType) {
) )
} }
function getContextVm (vm) {
let $parent = vm.$parent;
// 父组件是 scoped slots 或者其他自定义组件时继续查找
while ($parent && $parent.$parent && ($parent.$options.generic || $parent.$parent.$options.generic || $parent.$scope._$vuePid)) {
$parent = $parent.$parent;
}
return $parent && $parent.$parent
}
function handleEvent (event) { function handleEvent (event) {
event = wrapper$1(event); event = wrapper$1(event);
...@@ -1105,12 +1110,8 @@ function handleEvent (event) { ...@@ -1105,12 +1110,8 @@ function handleEvent (event) {
const methodName = eventArray[0]; const methodName = eventArray[0];
if (methodName) { if (methodName) {
let handlerCtx = this.$vm; let handlerCtx = this.$vm;
if ( if (handlerCtx.$options.generic) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx.$options.generic && handlerCtx = getContextVm(handlerCtx) || handlerCtx;
handlerCtx.$parent &&
handlerCtx.$parent.$parent
) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots
handlerCtx = handlerCtx.$parent.$parent;
} }
if (methodName === '$emit') { if (methodName === '$emit') {
handlerCtx.$emit.apply(handlerCtx, handlerCtx.$emit.apply(handlerCtx,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册