后台:
1.添加app/controllers/interface/xxx_controller.rb文件,写上需要的接口(json)
    注意事项:
      1.index的接口:
         模式:循环用map
         类别区分:用where
      2.show的接口:
         模式:不要循环
         区分类别:用if/else语句
3.对于没有数据的栏位要用rescue
   eg:yezhu: (@case.mobile_user.name rescue '')
   或者用SQL workbench添加数据。
4. 如果接口下方有需要用的关联的表,那么在上面的表后面要加上includes(:xxx)
   用逗号隔开,如有多个也要都写上ps:添加默认值:在需要的栏位后面加上  【  || 默认值 】
    如果默认值是字符串则需要用””括起来!
前端向后台传数据的时候,写在接口中的find后面需要insert的参数2.在config/routes.rb中添加路径
  如
1  | namespace :interface do  | 
created () {
    this.$http.get(‘api/interface/homes’).then((response) => {
      console.info(response.body)
      this.response = response.body
    }, (error) => {
      console.error(error)
    });
  },
1  | ('api/interface/cases/she_ji_shi_info' ,{params:{id: this.id}})  | 
 data () {
    return {
      response: {
        sliders: [],
        categories: [],
        fuwus: [],
        zhibos: [],
        guanggaotu: [],
      },
    }
    index: 0,
  },
注意: show页面data中要添加寻找id的语句(写在return里面定义的变量外面---index的下面,要写在定义的变量上面)
       eg:
       $ id: this.$router.app.$route.params.id,
    3.在<template>标签下解析要显示的数据
      response.item(要显示的栏位名)
      ps: 数组解析用v-for
几种解析模式:
           1.字段    {{ xxx.xxx}}
           2.图片    <img :src="xxx.xxx" style="height:100%; width:100%;"></img>