提交 d248cf2c 编写于 作者: fxy060608's avatar fxy060608

build:all

上级 9394389c
......@@ -837,6 +837,11 @@ function initProperties (props, isBehavior = false, file = '') {
type: String,
value: ''
};
// 用于字节跳动小程序模拟抽象节点
properties.generic = {
type: Object,
value: null
};
properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
......
......@@ -640,16 +640,18 @@ const protocols = { // 需要做转换的 API 列表
getSavedFileInfo: {
args: {
filePath: 'apFilePath'
},
returnValue (result) {
if (result.fileList && result.fileList.length) {
result.fileList.forEach(file => {
file.filePath = file.apFilePath;
delete file.apFilePath;
});
}
return {}
}
},
getSavedFileList: {
returnValue (result) {
if (result.fileList && result.fileList.length) {
result.fileList.forEach(file => {
file.filePath = file.apFilePath;
delete file.apFilePath;
});
}
return {}
}
},
removeSavedFile: {
args: {
......@@ -1314,6 +1316,11 @@ function initProperties (props, isBehavior = false, file = '') {
type: String,
value: ''
};
// 用于字节跳动小程序模拟抽象节点
properties.generic = {
type: Object,
value: null
};
properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
......
......@@ -969,6 +969,11 @@ function initProperties (props, isBehavior = false, file = '') {
type: String,
value: ''
};
// 用于字节跳动小程序模拟抽象节点
properties.generic = {
type: Object,
value: null
};
properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
......@@ -1574,10 +1579,10 @@ function parseComponent (vueOptions) {
const componentOptions = parseBaseComponent(vueOptions, {
isPage,
initRelation
});
// 关于百度小程序生命周期的说明(组件作为页面时):
// lifetimes:attached --> methods:onShow --> methods:onLoad --> methods:onReady
});
// 关于百度小程序生命周期的说明(组件作为页面时):
// lifetimes:attached --> methods:onShow --> methods:onLoad --> methods:onReady
// 这里在强制将onShow挪到onLoad之后触发,另外一处修改在page-parser.js
const oldAttached = componentOptions.lifetimes.attached;
componentOptions.lifetimes.attached = function attached () {
......@@ -1587,28 +1592,22 @@ function parseComponent (vueOptions) {
this.pageinstance.$vm = this.$vm;
if (hasOwn(this.pageinstance, '_$args')) {
this.$vm.$mp.query = this.pageinstance._$args;
this.$vm.__call_hook('onLoad', this.pageinstance._$args);
this.$vm.__call_hook('onLoad', this.pageinstance._$args);
this.$vm.__call_hook('onShow');
delete this.pageinstance._$args;
}
} else {
// 百度小程序组件不触发methods内的onReady
if (this.$vm) {
this.$vm._isMounted = true;
this.$vm.__call_hook('mounted');
}
} else {
// 百度小程序组件不触发methods内的onReady
if (this.$vm) {
this.$vm._isMounted = true;
this.$vm.__call_hook('mounted');
}
}
};
if (newLifecycle) {
componentOptions.methods.onReady = componentOptions.lifetimes.ready;
delete componentOptions.lifetimes.ready;
componentOptions.methods.onReady = function () {
if (this.$vm) {
this.$vm._isMounted = true;
this.$vm.__call_hook('mounted');
this.$vm.__call_hook('onReady');
}
};
}
componentOptions.messages = {
......
......@@ -895,6 +895,11 @@ function initProperties (props, isBehavior = false, file = '') {
type: String,
value: ''
};
// 用于字节跳动小程序模拟抽象节点
properties.generic = {
type: Object,
value: null
};
properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
......
......@@ -987,6 +987,11 @@ function initProperties (props, isBehavior = false, file = '') {
type: String,
value: ''
};
// 用于字节跳动小程序模拟抽象节点
properties.generic = {
type: Object,
value: null
};
properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
......
......@@ -852,6 +852,11 @@ function initProperties (props, isBehavior = false, file = '') {
type: String,
value: ''
};
// 用于字节跳动小程序模拟抽象节点
properties.generic = {
type: Object,
value: null
};
properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
......
......@@ -837,6 +837,11 @@ function initProperties (props, isBehavior = false, file = '') {
type: String,
value: ''
};
// 用于字节跳动小程序模拟抽象节点
properties.generic = {
type: Object,
value: null
};
properties.vueSlots = { // 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
type: null,
value: [],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册