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

建设网站是什么职位wordpress 后台好卡

建设网站是什么职位,wordpress 后台好卡,适合乡镇开的十五种店,美橙互联送的网站源代码文章目录axios实现vue-resource实现上一篇#xff1a;#xff08;三十六#xff09;Vue解决Ajax跨域问题 先看一个github搜索案例 有一个搜索框#xff0c;输入相关用户名#xff0c;就能模糊搜索出用户#xff0c;展现到下方 第一步#xff1a;我们用到了第三方样式库… 文章目录axios实现vue-resource实现上一篇三十六Vue解决Ajax跨域问题 先看一个github搜索案例 有一个搜索框输入相关用户名就能模糊搜索出用户展现到下方 第一步我们用到了第三方样式库bootstrap首先需要在public文件夹见一个css文件夹放入样式库然后在index.html页面进行引入 !-- 引入第三方样式 --link relstylesheet href%BASE_URL%css/bootstrap.css第二步拆分组件搜索跟文本框为一个组件Search展示用户为一个组件List axios实现 通用的 Ajax 请求库, 官方推荐使用比较广泛 axios安装命令npm i axios App组件 templatediv classcontainerSearch/List//div /template script import Search from /components/Search; import List from /components/List; export default {name: App,components: {List, Search}, } /script style /styleSeach组件 templatesection classjumbotronh3 classjumbotron-headingSearch Github Users/h3divinput typetext placeholderenter the name you search v-modelkeyWord/nbsp;button clicksearchUsersSearch/button/div/section /templatescriptimport axios from axios;export default {// eslint-disable-next-line vue/multi-word-component-namesname: Search,data(){return{keyWord:}},methods:{searchUsers(){if (this.keyWord ){alert(输入不能为空)return}//请求前更新List的数据this.$bus.$emit(updateListData,{isFirst:false,isLoading:true,errMsg:,users:[]})axios.get(https://api.github.com/search/users?q${this.keyWord}).then(response {//请求成功后更新List的数据this.$bus.$emit(updateListData,{isLoading:false,errMsg:,users:response.data.items})},error {console.log(请求失败,error.message)//请求后更新List的数据this.$bus.$emit(updateListData,{isLoading:false,errMsg:error.message,users:[]})})}} } /script style scoped /styleList组件 templatediv classrow!--展示用户列表--div v-showinfo.users.length classcard v-foruser in info.users :keyuser.logina :hrefuser.html_url target_blankimg :srcuser.avatar_url stylewidth: 100px//ap classcard-text{{user.login}}/p/div!--展示欢迎词--h2 v-showinfo.isFirst欢迎使用/h2!--展示加载中--h2 v-showinfo.isLoading加载中..../h2!--展示错误信息--h2 v-showinfo.errMsg{{info.errMsg}}/h2/div /templatescript export default {// eslint-disable-next-line vue/multi-word-component-namesname: List,data(){return{info: {isFirst:true,isLoading:false,errMsg:,users:[]}}},mounted() {this.$bus.$on(updateListData,(dataObj){this.info {...this.info,...dataObj}})} } /scriptstyle scoped .album {min-height: 50rem; /* Can be removed; just added for demo purposes */padding-top: 3rem;padding-bottom: 3rem;background-color: #f7f7f7; }.card {float: left;width: 33.333%;padding: .75rem;margin-bottom: 2rem;border: 1px solid #efefef;text-align: center; }.card img {margin-bottom: .75rem;border-radius: 100px; }.card-text {font-size: 85%; } /stylevue-resource实现 vue-resource是一个插件库对ajax进行了封装用法与axios差不多。 vue-resource安装命令npm i vue-resource 使用这个插件之后Vue和VueComponent身上就多了个$http通过$http.get或$http.post进行Ajax请求 vue 插件库, vue1.x 使用广泛官方已不维护。 安装完之后需要在mian.js进行引入 import vueResource from vue-resource; Vue.use(vueResource)Seach组件改为 templatesection classjumbotronh3 classjumbotron-headingSearch Github Users/h3divinput typetext placeholderenter the name you search v-modelkeyWord/nbsp;button clicksearchUsersSearch/button/div/section /templatescriptimport axios from axios;export default {// eslint-disable-next-line vue/multi-word-component-namesname: Search,data(){return{keyWord:}},methods:{searchUsers(){if (this.keyWord ){alert(输入不能为空)return}//请求前更新List的数据this.$bus.$emit(updateListData,{isFirst:false,isLoading:true,errMsg:,users:[]})this.$http.get(https://api.github.com/search/users?q${this.keyWord}).then(response {//请求成功后更新List的数据this.$bus.$emit(updateListData,{isLoading:false,errMsg:,users:response.data.items})},error {console.log(请求失败,error.message)//请求后更新List的数据this.$bus.$emit(updateListData,{isLoading:false,errMsg:error.message,users:[]})})}} } /scriptstyle scoped/style
http://www.hkea.cn/news/14501204/

相关文章:

  • 网站开发需要有登陆界面的网站wordpress 主题 星球
  • 一个专门做ppt的网站中国互联网金融公司排名
  • 门户网站html模板下载驾校网站建设方案
  • 淮安做网站优化wordpress显示用户自定义
  • 做好网站改版工作长沙网站seo源头厂家
  • 餐饮加盟网站怎么做如何制作网页设计
  • 微信推送在哪个网站做来宾网站建设
  • 二手房交易网站排行古典网站织梦模板
  • 有没有做软件的网站中国检验认证集团北京有限公司
  • 宾馆网站制作电子商务网站设计代做
  • wix做网站教程如何重新做公司网站
  • c 网站开发山东省专业群建设网站
  • 英德市住房和城乡建设局网站关于公司网站建设情况的汇报
  • 用什么语言来做网站北京网站设计与建设
  • 重庆网站制作服务wordpress设置网站主题
  • 潍坊网站建设解决方案湛江定制建站
  • 子域名做微信开放平台网站应用网站建设编程
  • 如何自建设网站赣州网站建设哪家公司好
  • 做悬赏的网站网站建设论文要求
  • 九龙坡区建设二校有网站吗鳌江哪里有做网站
  • 顺德大良那里做网站好wordpress首页轮播图
  • 湘潭学校网站建设 磐石网络重庆建设工程质量监督检测中心
  • 网站建设拾金手指下拉汕头市通信建设管理局网站
  • asp网站建设 文献综述wordpress 36氪主题
  • 诚信网站费用上海黄页固定电话查询
  • 有网站如何做直播海珠网站建设报价
  • 起名最好的网站排名网页游戏传奇合击版
  • 教做世界美食的网站wordpress主题国内模板
  • html5网站制作实战人力招聘网站建设的简要任务执行书
  • 吉安高端网站建设公司网站建设行业广告语