父组件代码
<template>
<view class="content">
<image class="logo" src="/static/logo.png"></image>
<view class="text-area">
<text class="title">{{ title }}</text>
</view>
<hello></hello>
</view>
</template>
<script lang="ts">
import { Vue, Component } from 'vue-property-decorator';
import Hello from './Hello';
@Component({
name: 'Index',
components:{
Hello
}
})
export default class Index extends Vue {
title: string = '我是父组件';
}
</script>
子组件代码
<view class="content">
<text class="title">--{{ title }}--</text>
</view>
</template>
<script lang="ts">
import { Vue, Component } from 'vue-property-decorator';
@Component({
name: 'Hello'
})
export default class Hello extends Vue {
title: string = '我是子组件';
}
</script>```
app 模拟器结果
微信小程序结果
真机结果
期望渲染结果一致
已装插件集合
目录
代码压缩包