|
今天用vfor 写了一下代码,怎么提示 ReferenceError: index$1 is not defined 这个错误
代码如下:
- <template>
- <view v-for="(item,index) in Array.from(length:5)"
- :class="activeSwiperIndex == index ? 'swiper-actvie':'swiper-nomarl'"></view>
- </template>
- <style>
- </style>
- <script>
- export default {
- name: 'test',
- data() {
- return {
- activeSwiperIndex: 0
- }
- },
- methods: {
- }
- }
- </script>
复制代码 经过编译后的文件内容如下
|
|