|
[多端开发]
在V-for 中 使用 v-model 绑定循环的数据问题
[复制链接]
具体报错为:
Cannot read property 'name' of undefined
直接上代码吧,不知道该咋描述了
- <template name='order_evaluation'>
- <view class="page">
- <scroll-view scroll-y show-scrollbar="false" class="flex-1">
- <view class="goods-box">
- <view v-for="(items,index) in list" class="">
- <textarea name="" id="" cols="30" rows="10" v-model="items.name"></textarea>
- </view>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- name: 'order_evaluation',
- apiready() {//like created
- },
- data() {
- return {
- list: [{
- name: ''
- }, {
- name: 1
- }]
- }
- },
- methods: {
- back() {
- api.closeWin()
- }
- }
- }
- </script>
- <style>
- .flex-1 {
- flex: 1;
- }
- .disflex-v-center {
- flex-flow: row;
- align-items: center;
- justify-content: flex-start;
- }
- .width-100p {
- width: 100%;
- }
- .bg-f7 {
- background: #f7f7f7;
- }
- .position {
- position: absolute;
- bottom: 14px;
- right: 10px;
- }
- .text-box {
- margin-top: 10px;
- /* width: 100%; */
- margin-left: 14px;
- margin-right: 14px;
- height: 86px;
- background: #f7f7f7;
- position: relative;
- }
- .c999 {
- color: #999;
- }
- .img-style {
- width: 61px;
- height: 61px;
- border-radius: 6px;
- }
- .padding-14 {
- padding: 14px 14px 10px 14px;
- }
- .goods-box {
- width: 100%;
- height: 347px;
- background: #ffffff;
- border-radius: 10px;
- }
- .page {
- height: 100%;
- background: #f7f7f7;
- }
- </style>
复制代码 大佬你测试一下就知道了
|
|