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

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定

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

<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 回答

這里的道理很簡單,因?yàn)槟阍贗nfo頁面沒有告訴它要顯示第幾個(gè)啊。

你的LoadMore方法只是把路由跳轉(zhuǎn)了,并沒有傳參數(shù)啊,小伙伴。

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

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

kingchan 提問者

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

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

0 回復(fù) 有任何疑惑可以回復(fù)我~

謝謝老師,是這樣?

lookMore () {

store.state.current = this.current

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


0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Brian

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

舉報(bào)

0/150
提交
取消

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

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號