persisted(persisted固定搭配)
persist后是doing还是todo
坚持做某事的英语短语:persistindoingsth.
persist:v.顽强地坚持;执著地做;维持;保持;持续存在;
第三人称单数:persists现在分词:persisting过去式:persisted过去分词:persisted扩展资料
Eveninthisdayandagetheoldattitudespersist.
即使在今天这个时代,这些陈旧的'观念依然存在。
Theseproblemspersistedformuchofthedecade.
这些问题在那10年的大部分时间里一直存在。
Ifthesymptomspersist,itisimportanttogotoyourdoctor.
如果这些症状持续存在,一定要去看医生。
discourage短语
discourage的常用短语:
用作动词(v.)
discouragefrom(v.+prep.)
阻止某人preventsbtodosth
discouragesbfromv-ing
用于be~ed结构
discourage的用法例句:
1.TheSwisswantedtodiscourageaninflowofforeignmoney.
瑞士人想要阻止外资流入。
2.Manyparentsfindithardtodiscouragebadbehaviour.
很多父母觉得要孩子循规蹈矩是件很难的事情。
3.Hisparentstriedtodiscouragehisinterestinmusic,buthepersisted.
他的父母设法打消他对音乐的兴趣,但他始终坚持。
4.acampaigntodiscouragesmokingamongteenagers
劝阻青少年吸烟的运动
5.Althoughshedidnotreciprocatehisfeelings,shedidnotdiscouragehim.
尽管她没有回应他的感情,她也没有使他丧失信心.
6.Ihavetriedtodiscouragehimfrombitingnails.
我曾劝阻他不要咬指甲.
7.Don'tletonefailurediscourageyou.
勿因一次失败而气馁.
8.Wediscouragesmokinginthisschool.
在这所学校里我们劝阻吸烟.
本地state丢失怎么解决
.产生原因
store里的数据是保存在运行内存中的,当页面刷新时,页面会重新加载vue实例,store里面的数据就会被重新赋值。
2.解决办法
方法一
将state里的数据保存一份到本地存储(localStorage、sessionStorage、cookie)中
让页面在刷新前存store到localStorage中。当然,在页面刷新时还要读localStorage中的数据到store中,读取和储存都写在app.vue中。
exportdefault{
name:"App",
created(){
//在页面刷新时将vuex里的信息保存到localStorage里
window.addEventListener("beforeunload",()=>{
localStorage.setItem("messageStore",JSON.stringify(this.$store.state));
});
//在页面加载时读取localStorage里的状态信息
localStorage.getItem("messageStore")&&
this.$store.replaceState(
Object.assign(
this.$store.state,
JSON.parse(localStorage.getItem("messageStore"))
)
);
}
};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
方法二
1、安装
npminstall--savevuex-persistedstate
1
1
2、在store.js中引入





