feat(confirm): change icon postion to title

This commit is contained in:
JiwenBai 2019-08-01 14:38:26 +08:00
parent 9b87878bae
commit abb06df8fe
3 changed files with 13 additions and 9 deletions

View File

@ -31,6 +31,9 @@ export default {
const confirmInstance = this.$NModal.confirm({
title: 'Confirm',
content: 'Are u sure to ...?',
okText: 'Yes', // ok errorsuccess使
cancelText: 'No', //
onOk: () => {
console.log('click on ok', confirmInstance)
this.$NMessage.info('will be ok in 3 seconds')

View File

@ -8,6 +8,12 @@
<!-- <slot name="title"> -->
<div class="n-confirm__title">
<span class="n-confirm__title__text">
<n-icon
class="n-confirm__content__icon"
:type="iconType.type"
size="28"
:color="iconType.color"
/>
{{ title }}
</span>
@ -21,12 +27,6 @@
<!-- </slot> -->
<!-- <slot> -->
<div class="n-confirm__content">
<n-icon
class="n-confirm__content__icon"
:type="iconType.type"
size="28"
:color="iconType.color"
/>
<div
class="n-confirm__content__text"
v-html="content"
@ -53,7 +53,7 @@
auto-text-color
@click="handleOk"
>
{{ loading === true ? "loading" : okText }}
{{ loading === true ? "Loading" : okText }}
</n-button>
</div>
<!-- </slot> -->

View File

@ -38,9 +38,10 @@
margin-left: 12px;
}
.n-confirm__content__icon {
position: absolute;
// position: absolute;
vertical-align: middle;
left: 0;
margin-right: 8px;
// left: 0;
/* top: 50%;
transform: translateY(-50%); */
}