mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-02-17 13:20:52 +08:00
feat(confirm): change icon postion to title
This commit is contained in:
parent
9b87878bae
commit
abb06df8fe
@ -31,6 +31,9 @@ export default {
|
||||
const confirmInstance = this.$NModal.confirm({
|
||||
title: 'Confirm',
|
||||
content: 'Are u sure to ...?',
|
||||
okText: 'Yes', // 自定义ok按钮文字 error和success也可以使用
|
||||
cancelText: 'No', // 自定义取消按钮文字
|
||||
|
||||
onOk: () => {
|
||||
console.log('click on ok', confirmInstance)
|
||||
this.$NMessage.info('will be ok in 3 seconds')
|
||||
|
@ -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> -->
|
||||
|
@ -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%); */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user