解决VUE的Object出现的undefined问题

  • Post author:
  • Post category:vue

this.axios .get('http://xxx/xxx/xxxxx') .then(res => { this.cxsp = res[0]; console.log(this.cxsp) 调用时显示undefined console.log(this.cxsp.shangp_id) 用错了是因为传来的值是一个list,list里有2个list,原以为this.cxsp就能一次打开。但…

继续阅读 解决VUE的Object出现的undefined问题

用vue写一个简单的购物车案例

  • Post author:
  • Post category:vue

首先看一下案例需求: 下面是实现需求的具体代码: 个人建议使用v-model双向数据绑定,然后在用computed 计算属性 进行计算 <template> <div class="shop_main"> <h3>案例:购物车结算</h3> <div> <span>手机:价格 </span> <input t…

继续阅读 用vue写一个简单的购物车案例

vue-find()

  • Post author:
  • Post category:vue

Find用来遍历查找数组元素,当找到符合条件的元素时,直接返回。 所以Find元素只会返回符合条件的第一个元素。 navigationList:['大学1','大学2','大学3','大学4','大学5'] let newArr=[] newArr =this.navigationList.find(item=>item=='大学2') console.log(newArr) 版权声明:本文…

继续阅读 vue-find()

vue-element Transfer 穿梭框

  • Post author:
  • Post category:vue

vue 用穿梭框实现列的展示与不展示 HTML代码 + 注释 <el-dialog width="40%" title="自定义展示列" :visible.sync="customPresentationLog" append-to-body class="import-dialog" :close-on-click-modal="false" > <template> &…

继续阅读 vue-element Transfer 穿梭框

vue 数据类型 属性

  • Post author:
  • Post category:vue

data export default { name: 'app', data () { return { message:"hi vue !" } }, created(){ this.$emit('mes', this.message) } } props 组件实例的作用域是孤立的。这意味着不能 (也不应该) 在子组件的模板内直接引用父组件的数据。要让子组件使用父组件的数据,需要通过子组件的 …

继续阅读 vue 数据类型 属性

vue使用axios中的post请求时, 如何将json数据改为formdata类型

  • Post author:
  • Post category:vue

有些时候在用ajax发送post请求时 ,数据如下图⬇️ 在使用axios时的默认请求如下图 ⬇️ content-Type : application/json 请求体类型默认是json格式 就连发送的数据也是 request payload 的 * 那么问题来了, 怎么才能让 axios 发送 post 请求时变得和 ajax 发送 post 请求的一样呢 ? 解决方法⬇️ 1. 首先我们可以…

继续阅读 vue使用axios中的post请求时, 如何将json数据改为formdata类型

idea 运行vue项目

  • Post author:
  • Post category:vue

idea 运行vue项目 1、idea中安装vue.js 点击File–>Settings–>Plugins–>搜索vue.js插件,下面的图中我已经安装好了 2、到node官网下载安装node.js 官方下载链接 . node.js 安装过程 傻瓜式安装,直接下一步就可以了 3、配置node.js 环境 打开cmd命令窗口 输入 node -v npm -v 查看版本 node…

继续阅读 idea 运行vue项目

vue swiper animate如何使用

  • Post author:
  • Post category:vue

需要注意的是: animate的动画在一加载的时候,所有动画都加载完毕,所以翻到后面swiper页面时设置的delay就看不到了。使用“swiper-animate-effect”,每切换一帧都能看到对应的时延,即动画从0时刻开始。 1.先安装: npm install animate.css --save 2、下载animate.js包 打开链接: https://www.swiper.com.…

继续阅读 vue swiper animate如何使用

Spring Boot+Vue前后端分离项目接入科大讯飞——语音评测

  • Post author:
  • Post category:vue

因为讯飞官方提供的sdk没有Java的,所以我使用的是WebApi。其中有些注意事项官网有写出,可自行查看。 下面是具体的接入过程: 下载这个demo 然后把里面的三个文件复制到项目里 主要用到的是FileUtil.java这个文件 package com.olive.web.utils.kedaxunfei; import com.olive.utils.ReturnJson; import c…

继续阅读 Spring Boot+Vue前后端分离项目接入科大讯飞——语音评测

用vue实现各类弹出框组件

  • Post author:
  • Post category:vue

简单介绍一下vue中常用dialog组件的封装: 实现动态传入内容,实现取消,确认等回调函数。 首先写一个基本的弹窗样式,如上图所示。 在需要用到弹窗的地方中引入组件: import dialogBar from './dialog.vue' components:{ 'dialog-bar': dialogBar, }, <dialog-bar></dialog-bar>…

继续阅读 用vue实现各类弹出框组件