38 lines
		
	
	
		
			883 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			38 lines
		
	
	
		
			883 B
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <section class="AiDialogBtn">
 | |
|     <div @click="dialog=true">
 | |
|       <slot v-if="$scopedSlots.btn" name="btn"/>
 | |
|       <el-button v-else type="text">{{ text }}</el-button>
 | |
|     </div>
 | |
|     <ai-dialog :visible.sync="dialog" :title="dialogTitle" :width="width" :customFooter="customFooter" v-on="$listeners"
 | |
|                @onConfirm="dialog=false,$emit('onConfirm')" v-bind="$attrs">
 | |
|       <slot/>
 | |
|       <template #footer>
 | |
|         <el-button @click="dialog=false">关闭</el-button>
 | |
|       </template>
 | |
|     </ai-dialog>
 | |
|   </section>
 | |
| </template>
 | |
| 
 | |
| <script>
 | |
| export default {
 | |
|   name: "AiDialogBtn",
 | |
|   props: {
 | |
|     text: {default: "点击弹窗"},
 | |
|     dialogTitle: {default: "展示信息"},
 | |
|     customFooter: {default: true},
 | |
|     width: {default: "1200px"}
 | |
|   },
 | |
|   data() {
 | |
|     return {
 | |
|       dialog: false
 | |
|     }
 | |
|   }
 | |
| }
 | |
| </script>
 | |
| 
 | |
| <style lang="scss" scoped>
 | |
| .AiDialogBtn {
 | |
| }
 | |
| </style>
 |