js 自给自足数据测试

在haoka里看到了~ 单这样应该还是不行 需要安装一些~~~

 this.$http.get('/carousel').then(res => {
      // console.log(res)
      this.carousel = res.data
    }).catch(_ => {})
    // 读取产品分类
    this.$http.get('/goods_class').then(res => {
      this.classify = res.data
      Toast.clear()
    }).catch(_ => {
      Toast.clear()
    })

然后我们可以看到....  其实里面是有json 的 测试用

js 自给自足数据测试_第1张图片

{
  "code": 200,
  "data": [
    { "id": 1, "name": "1", 

env.development里面也写了~

路径是相对的.  /api/   什么的...

注意!!!!!!!!!!!

网址这边 一定要

VUE_APP_DOMAIN=/

// 项目API地址

VUE_APP_APIURL=/api/

// 项目图片地址

VUE_APP_IMGURL=/storage/

后面的斜杠  要有 不然网址不完整了 

 

===========组件引入

嗯...   这个逻辑倒是不错, 可以好好看看  (号卡 ) 不是死页面  而要依赖数据的传入  (仔细看看号卡)

你可能感兴趣的:(#,待解决,/,js学习之路)