You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by GitBox <gi...@apache.org> on 2019/02/25 03:31:14 UTC
[GitHub] chenzhaoqi opened a new issue #2155: [iOS] weex+vue,this.$refs.xxx.ref,普通div正常,但在v-for中的div返回undefined
chenzhaoqi opened a new issue #2155: [iOS] weex+vue,this.$refs.xxx.ref,普通div正常,但在v-for中的div返回undefined
URL: https://github.com/apache/incubator-weex/issues/2155
测试代码如下
> <template>
<scroller>
<div class="header" ref="header">Header</div>
<div v-for="item in ['0']" :key="item">
<div ref="for">{{item}}</div>
</div>
<text>ref={{refValue1}}</text>
<text>ref={{refValue2}}</text>
<div class="button" @click="onClick"></div>
</scroller>
</template>
> <script>
export default {
data() {
return {
refValue1: "",
refValue2: ""
}
},
methods: {
onClick() {
this.refValue1 = "" + this.$refs.header.ref;
this.refValue2 = "" + this.$refs.for.ref;
console.log("123");
}
}
}
</script>
> <style scoped>
.header {
padding-top: 50px;
}
.button {
width: 200px;
height: 100px;
background-color: #0000FF;
}
</style>

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services