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

fix(mp-weixin): uni://form-field (question/155373)

上级 ef6c3f24
......@@ -5,6 +5,7 @@ declare module '@vue/runtime-core' {
route: string
$scope: {
$getAppWebview?: () => PlusWebviewWebviewObject
setData(data: Record<string, unknown>, callback?: () => void): void
}
// 目前 H5,APP 平台 getCurrentPages 中获取的 page 对象调整为 vm 对象
$getAppWebview?: () => PlusWebviewWebviewObject
......
......@@ -339,7 +339,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -365,6 +365,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('my://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -392,7 +405,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
function findPropsData(properties, isPage) {
return ((isPage
......@@ -453,14 +466,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......
......@@ -437,7 +437,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -463,6 +463,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('swan://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -478,7 +491,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
......@@ -557,6 +570,22 @@ function findPagePropsData(properties) {
});
}
return propsData;
}
function initFormField(vm) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options;
if (isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')) {
vm.$watch('modelValue', () => {
vm.$scope &&
vm.$scope.setData({
name: vm.name,
value: vm.modelValue,
});
}, {
immediate: true,
});
}
}
function initData(_) {
......@@ -630,14 +659,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......@@ -888,6 +917,9 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
initComponentInstance(instance, options);
},
});
if (!isMiniProgramPage) {
initFormField(this.$vm);
}
},
ready() {
// 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
......
......@@ -23,7 +23,7 @@ export {
initBehaviors,
updateComponentProps,
} from './runtime/componentOptions'
export { initProps } from './runtime/componentProps'
export { initProps, initFormField } from './runtime/componentProps'
export {
initHooks,
initUnknownHooks,
......
......@@ -111,13 +111,13 @@ export function initBehaviors(vueOptions: ComponentOptions): string[] {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name')
vueProps.push('value')
vueProps.push('modelValue')
} else {
vueProps.name = {
type: String,
default: '',
}
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
}
......
import { ComponentPropsOptions } from '@vue/runtime-core'
import {
ComponentPropsOptions,
ComponentPublicInstance,
} from '@vue/runtime-core'
import { extend, isArray, isFunction, isPlainObject } from '@vue/shared'
import type { MPComponentOptions, MPComponentInstance } from './component'
// @ts-ignore
......@@ -24,7 +27,10 @@ const builtInProps = [
'uS',
]
function initDefaultProps(isBehavior: boolean = false) {
function initDefaultProps(
options: MPComponentOptions,
isBehavior: boolean = false
) {
const properties: Component.PropertyOption = {}
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -50,6 +56,19 @@ function initDefaultProps(isBehavior: boolean = false) {
},
}
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('__GLOBAL__://form-field')) {
properties.name = {
type: null,
value: '',
}
properties.value = {
type: null,
value: '',
}
}
}
return properties
}
......@@ -81,7 +100,7 @@ export function initProps(mpComponentOptions: MPComponentOptions) {
}
extend(
mpComponentOptions.properties,
initDefaultProps(),
initDefaultProps(mpComponentOptions),
initVirtualHostProps(mpComponentOptions.options)
)
}
......@@ -176,3 +195,26 @@ function findPagePropsData(properties: Record<string, any>) {
}
return propsData
}
export function initFormField(vm: ComponentPublicInstance) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options
if (
isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')
) {
vm.$watch(
'modelValue',
() => {
vm.$scope &&
vm.$scope.setData({
name: (vm as any).name,
value: (vm as any).modelValue,
})
},
{
immediate: true,
}
)
}
}
......@@ -437,7 +437,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -463,6 +463,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('ks://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -478,7 +491,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
......@@ -546,6 +559,22 @@ function findPagePropsData(properties) {
});
}
return propsData;
}
function initFormField(vm) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options;
if (isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')) {
vm.$watch('modelValue', () => {
vm.$scope &&
vm.$scope.setData({
name: vm.name,
value: vm.modelValue,
});
}, {
immediate: true,
});
}
}
function initData(_) {
......@@ -615,14 +644,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......@@ -854,6 +883,9 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
initComponentInstance(instance, options);
},
});
if (!isMiniProgramPage) {
initFormField(this.$vm);
}
},
ready() {
// 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
......
......@@ -400,7 +400,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -426,6 +426,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('tt://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -441,7 +454,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
......@@ -509,6 +522,22 @@ function findPagePropsData(properties) {
});
}
return propsData;
}
function initFormField(vm) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options;
if (isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')) {
vm.$watch('modelValue', () => {
vm.$scope &&
vm.$scope.setData({
name: vm.name,
value: vm.modelValue,
});
}, {
immediate: true,
});
}
}
function initData(_) {
......@@ -578,14 +607,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......@@ -844,9 +873,10 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
if (mpType === 'page' && !mpInstance.route && mpInstance.__route__) {
mpInstance.route = mpInstance.__route__;
}
const props = findPropsData(properties, mpType === 'page');
this.$vm = $createComponent({
type: vueOptions,
props: findPropsData(properties, mpType === 'page'),
props,
}, {
mpType,
mpInstance,
......@@ -858,6 +888,9 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
initComponentInstance(instance, options);
},
});
if (mpType === 'component') {
initFormField(this.$vm);
}
// 处理父子关系
initRelation(this, relationOptions);
}
......
......@@ -386,7 +386,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -412,6 +412,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('qq://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -427,7 +440,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
......@@ -495,6 +508,22 @@ function findPagePropsData(properties) {
});
}
return propsData;
}
function initFormField(vm) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options;
if (isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')) {
vm.$watch('modelValue', () => {
vm.$scope &&
vm.$scope.setData({
name: vm.name,
value: vm.modelValue,
});
}, {
immediate: true,
});
}
}
function initData(_) {
......@@ -567,14 +596,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......@@ -767,6 +796,9 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
initComponentInstance(instance, options);
},
});
if (!isMiniProgramPage) {
initFormField(this.$vm);
}
},
ready() {
// 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
......
......@@ -400,7 +400,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -426,6 +426,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('tt://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -441,7 +454,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
......@@ -509,6 +522,22 @@ function findPagePropsData(properties) {
});
}
return propsData;
}
function initFormField(vm) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options;
if (isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')) {
vm.$watch('modelValue', () => {
vm.$scope &&
vm.$scope.setData({
name: vm.name,
value: vm.modelValue,
});
}, {
immediate: true,
});
}
}
function initData(_) {
......@@ -582,14 +611,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......@@ -853,9 +882,10 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
if (mpType === 'page' && !mpInstance.route && mpInstance.__route__) {
mpInstance.route = mpInstance.__route__;
}
const props = findPropsData(properties, mpType === 'page');
this.$vm = $createComponent({
type: vueOptions,
props: findPropsData(properties, mpType === 'page'),
props,
}, {
mpType,
mpInstance,
......@@ -867,6 +897,9 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
initComponentInstance(instance, options);
},
});
if (mpType === 'component') {
initFormField(this.$vm);
}
// 处理父子关系
initRelation(this, relationOptions);
}
......
import { ComponentInternalInstance, ComponentPublicInstance } from 'vue'
import type { ComponentInternalInstance, ComponentPublicInstance } from 'vue'
// @ts-ignore
import { pruneComponentPropsCache } from 'vue'
import {
......@@ -8,6 +8,7 @@ import {
CreateLifetimesOptions,
initSetRef,
findPropsData,
initFormField,
} from '@dcloudio/uni-mp-core'
import {
......@@ -47,10 +48,12 @@ export function initLifetimes({
mpInstance.route = mpInstance.__route__
}
const props = findPropsData(properties, mpType === 'page')
this.$vm = $createComponent(
{
type: vueOptions,
props: findPropsData(properties, mpType === 'page'),
props,
},
{
mpType,
......@@ -68,6 +71,10 @@ export function initLifetimes({
}
) as ComponentPublicInstance
if (mpType === 'component') {
initFormField(this.$vm)
}
// 处理父子关系
initRelation(this, relationOptions)
}
......
......@@ -386,7 +386,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -412,6 +412,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('wx://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -439,7 +452,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
......@@ -507,6 +520,22 @@ function findPagePropsData(properties) {
});
}
return propsData;
}
function initFormField(vm) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options;
if (isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')) {
vm.$watch('modelValue', () => {
vm.$scope &&
vm.$scope.setData({
name: vm.name,
value: vm.modelValue,
});
}, {
immediate: true,
});
}
}
function initData(_) {
......@@ -579,14 +608,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......@@ -779,6 +808,9 @@ function initLifetimes({ mocks, isPage, initRelation, vueOptions, }) {
initComponentInstance(instance, options);
},
});
if (!isMiniProgramPage) {
initFormField(this.$vm);
}
},
ready() {
// 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
......
......@@ -8,6 +8,7 @@ import {
CreateComponentOptions,
CreateLifetimesOptions,
findPropsData,
initFormField,
} from '@dcloudio/uni-mp-core'
import {
......@@ -55,6 +56,7 @@ export function initLifetimes({
propsData = this.options as Record<string, any>
}
}
this.$vm = $createComponent(
{
type: vueOptions,
......@@ -75,6 +77,9 @@ export function initLifetimes({
},
}
) as ComponentPublicInstance
if (!isMiniProgramPage) {
initFormField(this.$vm)
}
},
ready(this: MPComponentInstance) {
// 当组件 props 默认值为 true,初始化时传入 false 会导致 created,ready 触发, 但 attached 不触发
......
......@@ -378,7 +378,7 @@ const builtInProps = [
// 小程序不能直接定义 $slots 的 props,所以通过 vueSlots 转换到 $slots
'uS',
];
function initDefaultProps(isBehavior = false) {
function initDefaultProps(options, isBehavior = false) {
const properties = {};
if (!isBehavior) {
// 均不指定类型,避免微信小程序 property received type-uncompatible value 警告
......@@ -404,6 +404,19 @@ function initDefaultProps(isBehavior = false) {
},
};
}
if (options.behaviors) {
// wx://form-field
if (options.behaviors.includes('qa://form-field')) {
properties.name = {
type: null,
value: '',
};
properties.value = {
type: null,
value: '',
};
}
}
return properties;
}
function initVirtualHostProps(options) {
......@@ -419,7 +432,7 @@ function initProps(mpComponentOptions) {
if (!mpComponentOptions.properties) {
mpComponentOptions.properties = {};
}
extend(mpComponentOptions.properties, initDefaultProps(), initVirtualHostProps(mpComponentOptions.options));
extend(mpComponentOptions.properties, initDefaultProps(mpComponentOptions), initVirtualHostProps(mpComponentOptions.options));
}
const PROP_TYPES = [String, Number, Boolean, Object, Array, null];
function parsePropType(type, defaultValue) {
......@@ -487,6 +500,22 @@ function findPagePropsData(properties) {
});
}
return propsData;
}
function initFormField(vm) {
// 同步 form-field 的 name,value 值
const vueOptions = vm.$options;
if (isArray(vueOptions.behaviors) &&
vueOptions.behaviors.includes('uni://form-field')) {
vm.$watch('modelValue', () => {
vm.$scope &&
vm.$scope.setData({
name: vm.name,
value: vm.modelValue,
});
}, {
immediate: true,
});
}
}
function initData(_) {
......@@ -556,14 +585,14 @@ function initBehaviors(vueOptions) {
if (behavior === 'uni://form-field') {
if (isArray(vueProps)) {
vueProps.push('name');
vueProps.push('value');
vueProps.push('modelValue');
}
else {
vueProps.name = {
type: String,
default: '',
};
vueProps.value = {
vueProps.modelValue = {
type: [String, Number, Boolean, Array, Object, Date],
default: '',
};
......@@ -818,9 +847,10 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
if (mpType === 'page' && !mpInstance.route && mpInstance.__route__) {
mpInstance.route = mpInstance.__route__;
}
const props = findPropsData(properties, mpType === 'page');
this.$vm = $createComponent({
type: vueOptions,
props: findPropsData(properties, mpType === 'page'),
props,
}, {
mpType,
mpInstance,
......@@ -832,6 +862,9 @@ function initLifetimes$1({ mocks, isPage, initRelation, vueOptions, }) {
initComponentInstance(instance, options);
},
});
if (mpType === 'component') {
initFormField(this.$vm);
}
// 处理父子关系
initRelation(this, relationOptions);
}
......
......@@ -81,7 +81,7 @@ var index = () => [
else {
uniStatLog(`已开启 uni统计${statVersion}.0 版本`);
if (statVersion === '2') {
uniStatDeviceLog('1【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097');
uniStatDeviceLog('【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097');
}
}
}
......
......@@ -77,8 +77,10 @@ export default () => [
uniStatLog(M['stat.warn.version'])
} else {
uniStatLog(`已开启 uni统计${statVersion}.0 版本`)
if(statVersion === '2') {
uniStatDeviceLog('【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097')
if (statVersion === '2') {
uniStatDeviceLog(
'【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097'
)
}
}
}
......@@ -89,8 +91,10 @@ export default () => [
uniStatLog(
M['stat.warn.tip'].replace('{version}', `${statVersion}.0`)
)
if(statVersion === '2') {
uniStatDeviceLog('【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097')
if (statVersion === '2') {
uniStatDeviceLog(
'【重要】因 HBuilderX 3.4.9 版本起,uni统计2.0 调整了安卓端 deviceId 获取方式,导致 uni统计2.0 App-Android平台部分统计数据不准确。如使用了HBuilderX 3.4.9 - 3.6.4版本且开通了uni统计2.0的应用,需要使用HBuilderX3.6.7及以上版本重新发布应用并升级 uniAdmin 云函数解决,详见:https://ask.dcloud.net.cn/article/40097'
)
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册