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

build:all

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