Vue点击按钮弹出独立页面(弹出窗口)

1.我是在一个页面写的,通过点击按钮判断修改状态

 

<template>
  <div>
    <div style="width: 100%;height: 100px;">
     <!-- 添加会员 -->
    <el-button type="primary" @click="sendmessage" style="margin-top: 30px;float: left; margin-left: 10px;margin-bottom: 25px;"><i class="el-icon-s-promotion">发送</i></el-button>
    <el-button type="primary" style="margin-top: 30px;float: left; margin-left: 5px;margin-bottom: 25px;">√全选</el-button>
    <el-button type="primary" style="margin-top: 30px;float: left; margin-left: 5px;margin-bottom: 25px;">×批量删除</el-button>

    </div>
 
    <!-- 弹出的页面内容 -->
    <el-dialog :visible.sync="getmessage">
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
        <el-form-item label="收件人:">
            <!-- 下拉框 -->
          <el-select v-model="value" placeholder="请选择">
            <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="">
            <el-input v-model="ruleForm" placeholder="标题信息" style="margin-top: 10px;"></el-input>
        </el-form-item>
        <el-form-item label="">
            <el-card style="height: 610px;">
              <quill-editor v-model="content" ref="myQuillEditor" style="height: 500px;" :options="editorOption">
              </quill-editor>
            </el-card>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="submitForm('ruleForm')" style="float:right">确定</el-button>
        </el-form-item>
    </el-form>
    </el-dialog>

 
    <!-- 表格 -->
    <el-table :data="tableData" style="width: 100%">
      <el-table-column label="">
        <div>
            <input type="checkbox" v-model="use1" id="r1"></input>
        </div>
      </el-table-column>
      <el-table-column label="标题" prop="date">
      </el-table-column>
      <el-table-column label="时间" prop="name">
      </el-table-column>
      <el-table-column label="接受条件" prop="date">
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">Edit</el-button>
          <el-button size="mini" type="danger" @click="handleDelete(scope.$index, scope.row)">Delete</el-button>
        </template>
      </el-table-column>
    </el-table> 
 
  </div>
</template>
 

script配置

<script>

export default {

  data() {
    
    return {
      //弹框
      getmessage:false

    }
  },
  methods:{
    //弹框
    sendmessage(){
        this.getmessage = true
    } 

  }
  
}
</script>

  弹出效果

 

Vue3中,可以通过以下几种方法来实现点击按钮弹出窗口的功能: 1. 使用Vue的弹窗组件(如Quasar QDialog组件):在按钮点击事件中调用弹窗组件的显示方法,从而实现点击按钮弹出自定义的弹窗。可以参考官方文档中的2.1和2.2部分来了解如何使用弹窗组件进行操作。 2. 使用Vue的通知组件(如Quasar Notify插件):在按钮点击事件中调用通知组件的显示方法,以弹出一个提示框。这种方式适用于简单的提示信息。 3. 使用自定义组件:你也可以自定义一个弹窗组件,然后在按钮点击事件中通过Vue的方法来控制弹窗的显示与隐藏。这种方式需要你手动编写弹窗的相关逻辑和样式。 总的来说,Vue3中实现点击按钮弹出窗口的功能有多种方法,可以根据具体的需求和使用的框架来选择合适的方式进行实现。在这些方法中,弹窗组件通常是最常见和方便的一种方式。你可以参考官方文档中提供的代码示例和说明来帮助你更好地理解和应用这些方法。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [vue3 + quasar 弹窗的几种方式](https://blog.youkuaiyun.com/band_mmbx/article/details/126242494)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值