父组件:
<template>
<view class="content">
<TestCom :subtitleTheme="subtitleTheme" />
</view>
</template>
<script>
export default {
components: { },
computed: {
subtitleTheme() {
return 'bottom';
},
},
methods: {},
};
</script>
<style scoped>
</style>
子组件:
<template>
<view>{{subtitleTheme}}</view>
</template>
<script>
export default {
props: {
subtitleTheme: {
type: String,
validator(val){
debugger
return ['bottom', 'right'].includes(val);
},
},
},
};
</script>
<style scoped></style>
codemeow (作者)
麻烦再看一下楼下的补充问题
2022-11-15 11:52
DCloud_UNI_GSQ
回复 codemeow: 正在看
2022-11-17 14:49