ant design vue-java -spring boot-mybatis plus笔记

1.vue画面调用js方法

<div :style="{marginTop:'100px',left: 0,bottom: 0,width: '100%',borderTop: '1px solid #e9e9e9',padding: '10px 16px',background: '#fff',textAlign: 'right',}">
          <a-button :style="{marginRight: '8px'}" @click="onClose" >取消</a-button>
          <a-button type="primary" @click="handleSubmit" >提交</a-button>
        </div>

2.js方法   handleSubmit()

handleSubmit (e) {
      e.preventDefault()// 取消事件的默认动作。
      const _this = this
      this.form.validateFieldsAndScroll((err, values) => { // 校验
        values.content = _this.formData.content
        if (!err) {
          values.video = _this.formData.video
          values.cover = _this.formData.cover
          values.fileList = JSON.stringify(_this.handleFileList())
          _this.loading = true
          if (_this.handleFileList().videoUrl.length < 1) { // 视频非空校验
            _this.$message.error('请重新上传视频')
            _this.loading = false
            return false
          }
          if (_this.handleFileList().coverUrl.length < 1) { // 图片非空校验
            _this.$message.error('请重新上传封面')
            _this.loading = false
        
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值