提交 57934b1c 编写于 作者: Q qiang

build: runtime

上级 09f840df
......@@ -1922,11 +1922,63 @@ function initEventChannel$1 () {
};
}
function initScopedSlotsParams () {
const center = {};
const parents = {};
Vue.prototype.$hasScopedSlotsParams = function (vueId) {
const has = center[vueId];
if (!has) {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
return has
};
Vue.prototype.$getScopedSlotsParams = function (vueId, name, key) {
const data = center[vueId];
if (data) {
const object = data[name] || {};
return key ? object[key] : object
} else {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
};
Vue.prototype.$setScopedSlotsParams = function (name, value) {
const vueId = this.$options.propsData.vueId;
const object = center[vueId] = center[vueId] || {};
object[name] = value;
if (parents[vueId]) {
parents[vueId].$forceUpdate();
}
};
Vue.mixin({
destroyed () {
const propsData = this.$options.propsData;
const vueId = propsData && propsData.vueId;
if (vueId) {
delete center[vueId];
delete parents[vueId];
}
}
});
}
function parseBaseApp (vm, {
mocks,
initRefs
}) {
initEventChannel$1();
{
initScopedSlotsParams();
}
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
......
......@@ -1615,11 +1615,63 @@ function initEventChannel$1 () {
};
}
function initScopedSlotsParams () {
const center = {};
const parents = {};
Vue.prototype.$hasScopedSlotsParams = function (vueId) {
const has = center[vueId];
if (!has) {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
return has
};
Vue.prototype.$getScopedSlotsParams = function (vueId, name, key) {
const data = center[vueId];
if (data) {
const object = data[name] || {};
return key ? object[key] : object
} else {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
};
Vue.prototype.$setScopedSlotsParams = function (name, value) {
const vueId = this.$options.propsData.vueId;
const object = center[vueId] = center[vueId] || {};
object[name] = value;
if (parents[vueId]) {
parents[vueId].$forceUpdate();
}
};
Vue.mixin({
destroyed () {
const propsData = this.$options.propsData;
const vueId = propsData && propsData.vueId;
if (vueId) {
delete center[vueId];
delete parents[vueId];
}
}
});
}
function parseBaseApp (vm, {
mocks,
initRefs
}) {
initEventChannel$1();
{
initScopedSlotsParams();
}
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
......@@ -1970,6 +2022,7 @@ function parseComponent (vueOptions) {
if (!this.$vm) {
oldAttached.call(this);
} else {
initMocks(this.$vm, mocks);
this.__fixInitData && this.__fixInitData();
}
if (isPage.call(this)) { // 百度 onLoad 在 attached 之前触发(基础库小于 3.70)
......
......@@ -1367,11 +1367,63 @@ function initEventChannel$1 () {
};
}
function initScopedSlotsParams () {
const center = {};
const parents = {};
Vue.prototype.$hasScopedSlotsParams = function (vueId) {
const has = center[vueId];
if (!has) {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
return has
};
Vue.prototype.$getScopedSlotsParams = function (vueId, name, key) {
const data = center[vueId];
if (data) {
const object = data[name] || {};
return key ? object[key] : object
} else {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
};
Vue.prototype.$setScopedSlotsParams = function (name, value) {
const vueId = this.$options.propsData.vueId;
const object = center[vueId] = center[vueId] || {};
object[name] = value;
if (parents[vueId]) {
parents[vueId].$forceUpdate();
}
};
Vue.mixin({
destroyed () {
const propsData = this.$options.propsData;
const vueId = propsData && propsData.vueId;
if (vueId) {
delete center[vueId];
delete parents[vueId];
}
}
});
}
function parseBaseApp (vm, {
mocks,
initRefs
}) {
initEventChannel$1();
{
initScopedSlotsParams();
}
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
......
......@@ -1528,11 +1528,63 @@ function initEventChannel$1 () {
};
}
function initScopedSlotsParams () {
const center = {};
const parents = {};
Vue.prototype.$hasScopedSlotsParams = function (vueId) {
const has = center[vueId];
if (!has) {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
return has
};
Vue.prototype.$getScopedSlotsParams = function (vueId, name, key) {
const data = center[vueId];
if (data) {
const object = data[name] || {};
return key ? object[key] : object
} else {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
};
Vue.prototype.$setScopedSlotsParams = function (name, value) {
const vueId = this.$options.propsData.vueId;
const object = center[vueId] = center[vueId] || {};
object[name] = value;
if (parents[vueId]) {
parents[vueId].$forceUpdate();
}
};
Vue.mixin({
destroyed () {
const propsData = this.$options.propsData;
const vueId = propsData && propsData.vueId;
if (vueId) {
delete center[vueId];
delete parents[vueId];
}
}
});
}
function parseBaseApp (vm, {
mocks,
initRefs
}) {
initEventChannel$1();
{
initScopedSlotsParams();
}
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
......
......@@ -1620,11 +1620,63 @@ function initEventChannel$1 () {
};
}
function initScopedSlotsParams () {
const center = {};
const parents = {};
Vue.prototype.$hasScopedSlotsParams = function (vueId) {
const has = center[vueId];
if (!has) {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
return has
};
Vue.prototype.$getScopedSlotsParams = function (vueId, name, key) {
const data = center[vueId];
if (data) {
const object = data[name] || {};
return key ? object[key] : object
} else {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
};
Vue.prototype.$setScopedSlotsParams = function (name, value) {
const vueId = this.$options.propsData.vueId;
const object = center[vueId] = center[vueId] || {};
object[name] = value;
if (parents[vueId]) {
parents[vueId].$forceUpdate();
}
};
Vue.mixin({
destroyed () {
const propsData = this.$options.propsData;
const vueId = propsData && propsData.vueId;
if (vueId) {
delete center[vueId];
delete parents[vueId];
}
}
});
}
function parseBaseApp (vm, {
mocks,
initRefs
}) {
initEventChannel$1();
{
initScopedSlotsParams();
}
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
......
......@@ -1285,11 +1285,63 @@ function initEventChannel () {
};
}
function initScopedSlotsParams () {
const center = {};
const parents = {};
Vue.prototype.$hasScopedSlotsParams = function (vueId) {
const has = center[vueId];
if (!has) {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
return has
};
Vue.prototype.$getScopedSlotsParams = function (vueId, name, key) {
const data = center[vueId];
if (data) {
const object = data[name] || {};
return key ? object[key] : object
} else {
parents[vueId] = this;
this.$on('hook:destory', () => {
delete parents[vueId];
});
}
};
Vue.prototype.$setScopedSlotsParams = function (name, value) {
const vueId = this.$options.propsData.vueId;
const object = center[vueId] = center[vueId] || {};
object[name] = value;
if (parents[vueId]) {
parents[vueId].$forceUpdate();
}
};
Vue.mixin({
destroyed () {
const propsData = this.$options.propsData;
const vueId = propsData && propsData.vueId;
if (vueId) {
delete center[vueId];
delete parents[vueId];
}
}
});
}
function parseBaseApp (vm, {
mocks,
initRefs
}) {
initEventChannel();
{
initScopedSlotsParams();
}
if (vm.$options.store) {
Vue.prototype.$store = vm.$options.store;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册