nuxt中vue页面下sprict标签内的一些方法
<sprict>
export default{
head:{
title: '用户注册',
link: [ {rel:'stylesheet',href:'/style/login.css'} ],
script: []
},
components: {
TopNav,
HeaderLogo,
Footer },
data(){
return{
}
},
methods:{
},
watch: {
'$store.state.keyword': function(newValue,oldValue){
this.searchMap.keyword = newValue;
this.searchList();
} },
watch:{
selectAllChecked:{
async handler(newCart,oldCart){
},
immediate:false,
deep:true } }
async mounted(){
let token=sessionStorage.getItem('token');
if(token){
let {data:loginer}=await this.$request.getCart();
this.cart=data.data;
}else{
let cartStr=localStorage.getItem('cart');
this.cart=JSON.parse(cartStr);
}},
}
<script>