|
@@ -7,29 +7,30 @@
|
|
|
</div>
|
|
|
<div class="body">
|
|
|
<div class="typeImg">
|
|
|
- <img style="height:48px;width:48px" v-if="type == 'success'" src="@/assets/images/icon/success.png" alt="" />
|
|
|
- <img style="height:48px;width:48px" v-else-if="type == 'warn'" src="@/assets/images/icon/warn.png" alt="" />
|
|
|
- <img style="height:48px;width:48px" v-else src="@/assets/images/icon/error.png" alt="" />
|
|
|
+ <img
|
|
|
+ style="height: 48px; width: 48px"
|
|
|
+ v-if="type == 'success'"
|
|
|
+ src="@/assets/images/icon/success.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ style="height: 48px; width: 48px"
|
|
|
+ v-else-if="type == 'warn'"
|
|
|
+ src="@/assets/images/icon/warn.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ style="height: 48px; width: 48px"
|
|
|
+ v-else
|
|
|
+ src="@/assets/images/icon/error.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
</div>
|
|
|
<span>{{ options.text }}</span>
|
|
|
</div>
|
|
|
<div class="footer">
|
|
|
- <button
|
|
|
- @click="
|
|
|
- cancelCallback
|
|
|
- "
|
|
|
- size="mini"
|
|
|
- type="gray"
|
|
|
- >
|
|
|
- 取消
|
|
|
- </button>
|
|
|
- <button
|
|
|
- @click="confirmCallback"
|
|
|
- size="mini"
|
|
|
- type="primary"
|
|
|
- >
|
|
|
- 确认
|
|
|
- </button>
|
|
|
+ <!-- <button @click="cancelCallback" size="mini" type="gray">取消</button> -->
|
|
|
+ <button @click="confirmCallback" size="mini" type="primary">确认</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -48,12 +49,12 @@ export default {
|
|
|
},
|
|
|
options: {
|
|
|
type: Object,
|
|
|
- default: ()=>{
|
|
|
+ default: () => {
|
|
|
return {
|
|
|
- title:'',
|
|
|
- text:'',
|
|
|
- type:'success',
|
|
|
- callback:()=>{}
|
|
|
+ title: '',
|
|
|
+ text: '',
|
|
|
+ type: 'success',
|
|
|
+ callback: () => {}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -62,16 +63,11 @@ export default {
|
|
|
type: Function,
|
|
|
default: () => {}
|
|
|
},
|
|
|
- // 确认按钮
|
|
|
- confirmCallback: {
|
|
|
- type: Function,
|
|
|
- default: () => {}
|
|
|
- },
|
|
|
// 取消按钮
|
|
|
- cancelCallback: {
|
|
|
- type: Function,
|
|
|
- default: () => {}
|
|
|
- }
|
|
|
+ // cancelCallback: {
|
|
|
+ // type: Function,
|
|
|
+ // default: () => {}
|
|
|
+ // }
|
|
|
},
|
|
|
setup(props) {
|
|
|
// 点击 target 目标元素外部相当于点击了取消
|
|
@@ -79,7 +75,14 @@ export default {
|
|
|
// onClickOutside(target, () => {
|
|
|
// props.cancelCallback()
|
|
|
// })
|
|
|
- return { target }
|
|
|
+ function cancelCallback() {
|
|
|
+ props.close()
|
|
|
+ }
|
|
|
+ function confirmCallback() {
|
|
|
+ props.options.callback()
|
|
|
+ props.close()
|
|
|
+ }
|
|
|
+ return { target,confirmCallback,cancelCallback }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -122,26 +125,26 @@ export default {
|
|
|
margin-right: 3px;
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
- .typeImg{
|
|
|
+ .typeImg {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
}
|
|
|
.footer {
|
|
|
// text-align: right;
|
|
|
- border-top: 1px solid #EBEBEB;
|
|
|
+ border-top: 1px solid #ebebeb;
|
|
|
padding: 20px;
|
|
|
.xtx-button {
|
|
|
margin-left: 20px;
|
|
|
}
|
|
|
- button{
|
|
|
+ button {
|
|
|
height: 40px;
|
|
|
- background: #29B2FF;
|
|
|
+ background: #29b2ff;
|
|
|
border-radius: 4px 4px 4px 4px;
|
|
|
opacity: 1;
|
|
|
font-size: 14px;
|
|
|
font-family: PingFang SC-Regular, PingFang SC;
|
|
|
font-weight: 400;
|
|
|
- color: #FFFFFF;
|
|
|
+ color: #ffffff;
|
|
|
border: none;
|
|
|
padding: 10px 50px;
|
|
|
text-align: center;
|