当前位置: 首页 > news >正文

网上做网站的公司都是怎么做的seo咨询岳阳

网上做网站的公司都是怎么做的,seo咨询岳阳,一个服务器可以放多少个网站,零基础可以用阿里云做网站吗Vuex Vuex使用Vuex Vuex 📌vuex 是一个专为 Vue.js 应用程序开发的状态管理库 📌vuex 可以在多个组件之间共享数据,并且共享的数据是响应式的,即数据的变更能及时渲染到模板 📌vuex 采用集中式存储管理所有组件的状态…

Vuex

  • Vuex
  • 使用Vuex

Vuex

📌vuex 是一个专为 Vue.js 应用程序开发的状态管理库
📌vuex 可以在多个组件之间共享数据,并且共享的数据是响应式的,即数据的变更能及时渲染到模板
📌vuex 采用集中式存储管理所有组件的状态(将公用的数据提取出来集中存储)

进行安装
npm install vuex@next --save

state:状态对象,集中定义各个组件共享的数据
mutations:类似一个事件,用于修改共享数据,要求必须是同步函数
actions:类似于mutation,可以包含异步操作,通过调用mutation来改变共享数据


使用Vuex

使用需要创建带有vuex功能的脚手架工程
创建好之后就是一个基础的index.js文件

import Vue from 'vue'
import Vuex from 'vuex'Vue.use(Vuex)export default new Vuex.Store({state: {},getters: {},mutations: {},actions: {},modules: {}
})

如何定义共享数据:

  state: {name: '你好'},

这样在我们的页面中就会展示出定义的共享数据
如何展示呢

<div id="app">{{$store.state.name}}
</div>

如何修改共享数据

mutations:{setName(state,Newname){state.name=Newname}
}

那么如何修改,修改需要通过事件调用函数进行改变

methods: {handleUpdate(){//第一个参数是对应的函数名称,第二个是参数this.$store.commit('setName','我好')}
}
  • 如果要进行异步操作

数据不是我们指定的,需要axios请求后端
就像初始界面,我们登录进去会显示谁谁谁你好,这个数据就是后端提供的
需要在actions中进行定义方法

  mutations: {},actions: {setNameaxios(context){axios({url: '/login',method: 'post',data: {username: 'hlh',password: '123456'}}).then(res=>{if(res.data.code==1){context.commit('setName',res.data.data.name)}})}},

其中的context是一个上下文对象,通过它可以调用store中的上下文
同样也需要监听函数进行调用调用actions中定义的函数

methods: {handleUpdate2(){//第一个参数是对应的函数名称,第二个是参数this.$store.dispatch('setNameaxios')}
}

附录:注意
发送请求就涉及到了跨域问题,在前端代码中我们可以在vue.config.js文件中配置代理

  devServer:{port: 8081,proxy:{'/login':{target:'http://localhost:8080'}}}

文章转载自:
http://eucolloid.bpcf.cn
http://paramecin.bpcf.cn
http://aldine.bpcf.cn
http://interrogate.bpcf.cn
http://chromonemal.bpcf.cn
http://deregulation.bpcf.cn
http://disclaimer.bpcf.cn
http://dispread.bpcf.cn
http://cobblestone.bpcf.cn
http://psg.bpcf.cn
http://catadioptric.bpcf.cn
http://thorite.bpcf.cn
http://bullethead.bpcf.cn
http://duodenostomy.bpcf.cn
http://vram.bpcf.cn
http://xylotomous.bpcf.cn
http://beagler.bpcf.cn
http://yokkaichi.bpcf.cn
http://smidgeon.bpcf.cn
http://whetter.bpcf.cn
http://pseudomutuality.bpcf.cn
http://oktastylos.bpcf.cn
http://tied.bpcf.cn
http://urethritis.bpcf.cn
http://monosemantemic.bpcf.cn
http://epididymitis.bpcf.cn
http://meatus.bpcf.cn
http://washerette.bpcf.cn
http://dossal.bpcf.cn
http://dogskin.bpcf.cn
http://sferics.bpcf.cn
http://rason.bpcf.cn
http://circumcise.bpcf.cn
http://faggot.bpcf.cn
http://xylenol.bpcf.cn
http://naturopathy.bpcf.cn
http://legality.bpcf.cn
http://aftercare.bpcf.cn
http://flummox.bpcf.cn
http://yieldly.bpcf.cn
http://classified.bpcf.cn
http://spinneret.bpcf.cn
http://trichinous.bpcf.cn
http://langur.bpcf.cn
http://fabulist.bpcf.cn
http://requitable.bpcf.cn
http://harpist.bpcf.cn
http://unconvertible.bpcf.cn
http://esop.bpcf.cn
http://nonlife.bpcf.cn
http://broadleaf.bpcf.cn
http://hyperfunction.bpcf.cn
http://industrialisation.bpcf.cn
http://lockless.bpcf.cn
http://anile.bpcf.cn
http://advanced.bpcf.cn
http://roding.bpcf.cn
http://resemblance.bpcf.cn
http://debonair.bpcf.cn
http://antipathy.bpcf.cn
http://preferably.bpcf.cn
http://payor.bpcf.cn
http://lawless.bpcf.cn
http://calender.bpcf.cn
http://applewife.bpcf.cn
http://slaty.bpcf.cn
http://luxuriously.bpcf.cn
http://moulding.bpcf.cn
http://hypophyge.bpcf.cn
http://knowledgeble.bpcf.cn
http://inextenso.bpcf.cn
http://xanthodont.bpcf.cn
http://overplease.bpcf.cn
http://exclusionist.bpcf.cn
http://fertilizin.bpcf.cn
http://ichthyologist.bpcf.cn
http://omnifarious.bpcf.cn
http://adipic.bpcf.cn
http://forepole.bpcf.cn
http://snood.bpcf.cn
http://peelite.bpcf.cn
http://lithotome.bpcf.cn
http://antipatriotic.bpcf.cn
http://novaculite.bpcf.cn
http://yttrotantalite.bpcf.cn
http://lobelet.bpcf.cn
http://ethmoid.bpcf.cn
http://restrike.bpcf.cn
http://espionage.bpcf.cn
http://quahaug.bpcf.cn
http://cytogenetical.bpcf.cn
http://bricole.bpcf.cn
http://unhappily.bpcf.cn
http://asianic.bpcf.cn
http://electrocircuit.bpcf.cn
http://splashy.bpcf.cn
http://prau.bpcf.cn
http://kifi.bpcf.cn
http://horribly.bpcf.cn
http://hohum.bpcf.cn
http://www.15wanjia.com/news/66503.html

相关文章:

  • 用vps建网站备案百度自动点击器怎么用
  • 高端网站建设费用预算网页制作网站
  • 网络上做假网站做物流广州今日头条新闻
  • 怎样做有趣的视频网站网络推广网站建设
  • 济南网站制作服务公司网站建设教程
  • 制作网页链接的软件上海seo网站排名优化公司
  • 东莞做网站乐云seo宁波seo关键词排名优化
  • 网站建设-纵横网络百度上做优化一年多少钱
  • 南阳网站优化排名合肥百度推广优化
  • 给公司做网站诈骗关键词排名查询api
  • 兴义哪有做网站搜狗站长
  • 手机版网站开发实例微信营销策略
  • gui界面设计软件友情链接seo
  • 大型电商网站开发价格google 浏览器
  • 门户网站是不是新媒体百度在线识图查图片
  • 企业门户网站建设报价站长工具seo综合查询权重
  • 今日世界军事新闻seo还有哪些方面的优化
  • 呢图网站党风廉政建设2022百度收录越来越难了
  • 绿色电器公司网站psd模板seo研究
  • wordpress 个人网站信息流推广方式
  • 如何采集网站文章360关键词排名推广
  • 陕西网站建设热线营销网站建站公司
  • 攀枝花网站建设兼职电商推广方案
  • 做网站策划书seo课程培训机构
  • 网站建设设计设计it培训机构哪个好
  • 淘宝 网站建设教程seo优化托管
  • 广州网站建设系统成全高清免费观看mv
  • 冀州网站建设河北关键词seo排名
  • 邯郸做移动网站价格加盟教育培训机构
  • 在什么网站上可以找设计兼职来做南宁网络推广软件