第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

從list組件點擊查看更多路由到了Info組件永遠都是顯示的第一條新聞詳情

<template>
????<div>
????????<ul>
????????????<li?v-for="(item,index)?in?pageLists"
????????????????@click="look(index)"
????????????????:class="{active:?index?==?current?&&?current?!==?''}"
????????????????:key="index">
????????????????<span>{{item.title}}</span>
????????????????<p>{{item.content}}</p>
????????????????<small>{{dateTime}}</small>
????????????????<a?v-show="index?==?current?&&?current?!==?''"?@click="lookMore()">
????????????????????<small>查看更多>></small>
????????????????</a>
????????????</li>
????????</ul>
????</div>
</template>
<script>
????import?store?from?'@/store'
????export?default?{
????????name:?"List",
????????store,
????????data?()?{
????????????return?{
????????????????current:?'',
????????????????dateTime:?new?Date().toLocaleString()
????????????}
????????},
????????computed:?{
????????????pageLists?()?{
????????????????return?store.state.lists
????????????}
????????},
????????methods:{
????????????look?(index)?{
????????????????this.current?=?index
????????????},
????????????lookMore?()?{
????????????????this.$router.push('/info');
????????????}
????????}
????}
</script>
<template>
????<div>
????????<div?v-for="(item,index)?in?pageLists"
?????????????v-show="index?==?current"
?????????????:key="index">
????????????<span>{{item.title}}</span>
????????????<p>{{item.content}}</p>
????????</div>
????????<div?class="returnList"?@click="returnList()">返?&nbsp;?回</div>
????</div>
</template>
<script>
????import?store?from?'@/store'
????export?default?{
????????store,
????????name:?"Info",
????????data?()?{
????????????return?{
????????????????current:?'',
????????????}
????????},
????????computed:?{
????????????pageLists?()?{
????????????????return?store.state.lists
????????????}
????????},
????????methods:{
????????????returnList?()?{
????????????????this.$router.push('/home/list')
????????????}
????????}
????}
</script>


正在回答

3 回答

這里的道理很簡單,因為你在Info頁面沒有告訴它要顯示第幾個啊。

你的LoadMore方法只是把路由跳轉了,并沒有傳參數啊,小伙伴。

你要告訴Info頁面,我現(xiàn)在點的第幾個,你幫我展示一下下。

0 回復 有任何疑惑可以回復我~
#1

kingchan 提問者

謝謝老師,是這樣? lookMore () { store.state.current = this.current this.$router.push('/info'); }
2019-04-07 回復 有任何疑惑可以回復我~

解決了嗎。 我ifon組件顯示的是全部額

0 回復 有任何疑惑可以回復我~

謝謝老師,是這樣?

lookMore () {

store.state.current = this.current

this.$router.push('/info');
}


0 回復 有任何疑惑可以回復我~
#1

Brian

記住,改變vuex中state的唯一方式是mutation
2019-04-08 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

從list組件點擊查看更多路由到了Info組件永遠都是顯示的第一條新聞詳情

我要回答 關注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號