问答详情
源自:4-4 单页面应用 Demo2(1)

list页面上computed监听的pageList 没有数据,add添加页面可以正常添加到store里

<template>
  <div>
    新闻列表
 <ul>
      <li v-for="(item,index) in pageList"
          :key="index">
        {{item.title}}-{{item.content}}
      </li>

    </ul>
  </div>
</template>

<script>
  import store from '@/store'
  export default{
    name:'List',
    store,
    computed:{
      pageList(){
        return store.state.lists

      }
    }

  }
</script>

https://img4.mukewang.com/5d3fa5e40001c93410480941.jpg

提问者:夏日雨来临 2019-07-30 10:06

个回答