构建版本修改
This commit is contained in:
		
							
								
								
									
										33
									
								
								components/AiEditBtn.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								components/AiEditBtn.vue
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,33 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <section class="AiEditBtn">
 | 
			
		||||
    <el-button v-if="!edit" type="text" @click="handleOper('edit')">编辑</el-button>
 | 
			
		||||
    <template v-else>
 | 
			
		||||
      <el-button type="text" @click="handleOper('submit')">保存</el-button>
 | 
			
		||||
      <el-button type="text" @click="handleOper('cancel')">取消</el-button>
 | 
			
		||||
    </template>
 | 
			
		||||
  </section>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: "AiEditBtn",
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      edit: false
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    handleOper(event) {
 | 
			
		||||
      if (event != "submit") {
 | 
			
		||||
        this.edit = !this.edit
 | 
			
		||||
        this.$emit(event)
 | 
			
		||||
      } else this.$emit(event, () => this.edit = !this.edit)
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
.AiEditBtn {
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
		Reference in New Issue
	
	Block a user