使用了微信小程序的虚拟化组件节点的组件
<template>
<view :style="style">123123</view>
</template>
<script>
export default {
options: {
virtualHost: true,
},
externalClasses: ['class'],
props: ['styles', 'style'],
mounted() {
// 此处打印props
console.log({style: this.style, styles: this.styles})
},
}
</script>
页面使用
<MyComponent style="display: flex;align-items: center;justify-content: center;" styles="display: flex;" />
预期结果
{
style: "display: flex;align-items: center;justify-content: center;",
styles: "display: flex;"
}
实际结果
{
style: "",
styles: "display: flex;"
}