apache / incubator-weex

Apache Weex (Incubating)
https://weex.apache.org
Apache License 2.0
13.75k stars 1.82k forks source link

[Android] 0.28.0 子控件created 渲染父组件失败,导致白屏 #3216

Open bobSir opened 4 years ago

bobSir commented 4 years ago
<template>
  <pages-layout >
      <text v-for="i in message" :key="i" class="greeting">{{i}}</text>
  </pages-layout>
</template>

<script>
import PagesLayout from './test.vue';

export default {
  name: 'home',
  components: {
    PagesLayout,
  },
  data() {
    return {
      message: undefined,
    };
  },
  created(){
    console.log("00000");
  },
  mounted() {
    console.log("11111");
  },
};
</script>

<style scoped>
.greeting {
  text-align: center;
  font-size: 50px;
  color: #0091fa;
  background: blueviolet;
}
</style>
<template>
<div>
<slot></slot>
</div>
</template>

<script>

export default {
name: 'Layout',
created() {
console.log("@cly --11 "+this.$parent);
// this.$set(this.$parent, 'message', [...new Array(10)].map((item, i) => i));
},
mounted(){
console.log("@cly --22 "+this.$parent);
this.$set(this.$parent, 'message', [...new Array(10)].map((item, i) => i));
}

};
</script>
bobSir commented 4 years ago

0.20 版本渲染正常, 0.28.0 weex sdk 是否修改了组件渲染机制