-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from FriedRiceNoodles/docs/message
docs(message): added html source code for message
- Loading branch information
Showing
6 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<b-button type="primary">自定义提示时长</b-button> | ||
|
||
<script> | ||
const button = document.querySelector('b-button'); | ||
|
||
button.addEventListener('click', () => { | ||
window.BMessage.info({ content: '这条提示将会被展示10秒...', duration: 10 }); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<b-button type="primary">显示一个loading提示</b-button> | ||
|
||
<script> | ||
const button = document.querySelector('b-button'); | ||
|
||
button.addEventListener('click', () => { | ||
const messageId = window.BMessage.loading({ content: '正在加载...', duration: 0 }); | ||
setTimeout(() => { | ||
window.BMessage.closeMessage(messageId); | ||
}, 5000); | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div style="display: flex; gap: 10px; flex-wrap: wrap;"> | ||
<b-button id="infoBtn" type="primary">普通提示</b-button> | ||
<b-button id="successBtn" type="success">成功提示</b-button> | ||
<b-button id="errorBtn" type="danger">错误提示</b-button> | ||
<b-button id="warningBtn" type="warning">警告提示</b-button> | ||
</div> | ||
|
||
|
||
<script> | ||
function showInfo() { | ||
window.BMessage.info({ content: '一个普通提示' }); | ||
} | ||
|
||
function showSuccess() { | ||
window.BMessage.success({ content: '一个成功提示' }); | ||
} | ||
|
||
function showError() { | ||
window.BMessage.error({ content: '一个错误提示' }); | ||
} | ||
|
||
function showWarning() { | ||
window.BMessage.warning({ content: '一个警告提示' }); | ||
} | ||
|
||
document.getElementById('infoBtn').addEventListener('click', showInfo); | ||
document.getElementById('successBtn').addEventListener('click', showSuccess); | ||
document.getElementById('errorBtn').addEventListener('click', showError); | ||
document.getElementById('warningBtn').addEventListener('click', showWarning); | ||
</script> |