|
@@ -34,67 +34,61 @@
|
|
|
</CollapseContainer>
|
|
|
</PageWrapper>
|
|
|
</template>
|
|
|
-<script lang="ts">
|
|
|
- import { defineComponent } from 'vue';
|
|
|
+<script lang="ts" setup>
|
|
|
+ import { PageWrapper } from '/@/components/Page';
|
|
|
import { CollapseContainer } from '/@/components/Container/index';
|
|
|
+
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
- import { PageWrapper } from '/@/components/Page';
|
|
|
|
|
|
- export default defineComponent({
|
|
|
- components: { CollapseContainer, PageWrapper },
|
|
|
- setup() {
|
|
|
- const {
|
|
|
- createMessage,
|
|
|
- createConfirm,
|
|
|
- createSuccessModal,
|
|
|
- createInfoModal,
|
|
|
- createErrorModal,
|
|
|
- createWarningModal,
|
|
|
- notification,
|
|
|
- } = useMessage();
|
|
|
- const { info, success, warning, error } = createMessage;
|
|
|
+ const {
|
|
|
+ createMessage,
|
|
|
+ createConfirm,
|
|
|
+ createSuccessModal,
|
|
|
+ createInfoModal,
|
|
|
+ createErrorModal,
|
|
|
+ createWarningModal,
|
|
|
+ notification,
|
|
|
+ } = useMessage();
|
|
|
+
|
|
|
+ const {
|
|
|
+ info: infoMsg,
|
|
|
+ success: successMsg,
|
|
|
+ warning: warningMsg,
|
|
|
+ error: errorMsg,
|
|
|
+ } = createMessage;
|
|
|
+
|
|
|
+ function handleLoading() {
|
|
|
+ createMessage.loading('Loading...');
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleConfirm(type: 'warning' | 'error' | 'success' | 'info') {
|
|
|
+ createConfirm({
|
|
|
+ iconType: type,
|
|
|
+ title: 'Tip',
|
|
|
+ content: 'content message...',
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleSuccessModal() {
|
|
|
+ createSuccessModal({ title: 'Tip', content: 'content message...' });
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleErrorModal() {
|
|
|
+ createErrorModal({ title: 'Tip', content: 'content message...' });
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleWarningModal() {
|
|
|
+ createWarningModal({ title: 'Tip', content: 'content message...' });
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleInfoModal() {
|
|
|
+ createInfoModal({ title: 'Tip', content: 'content message...' });
|
|
|
+ }
|
|
|
|
|
|
- function handleLoading() {
|
|
|
- createMessage.loading('Loading...');
|
|
|
- }
|
|
|
- function handleConfirm(type: 'warning' | 'error' | 'success' | 'info') {
|
|
|
- createConfirm({
|
|
|
- iconType: type,
|
|
|
- title: 'Tip',
|
|
|
- content: 'content message...',
|
|
|
- });
|
|
|
- }
|
|
|
- function handleSuccessModal() {
|
|
|
- createSuccessModal({ title: 'Tip', content: 'content message...' });
|
|
|
- }
|
|
|
- function handleErrorModal() {
|
|
|
- createErrorModal({ title: 'Tip', content: 'content message...' });
|
|
|
- }
|
|
|
- function handleWarningModal() {
|
|
|
- createWarningModal({ title: 'Tip', content: 'content message...' });
|
|
|
- }
|
|
|
- function handleInfoModal() {
|
|
|
- createInfoModal({ title: 'Tip', content: 'content message...' });
|
|
|
- }
|
|
|
- function handleNotify() {
|
|
|
- notification.success({
|
|
|
- message: 'Tip',
|
|
|
- description: 'content message...',
|
|
|
- });
|
|
|
- }
|
|
|
- return {
|
|
|
- infoMsg: info,
|
|
|
- successMsg: success,
|
|
|
- warningMsg: warning,
|
|
|
- errorMsg: error,
|
|
|
- handleLoading,
|
|
|
- handleConfirm,
|
|
|
- handleSuccessModal,
|
|
|
- handleErrorModal,
|
|
|
- handleWarningModal,
|
|
|
- handleInfoModal,
|
|
|
- handleNotify,
|
|
|
- };
|
|
|
- },
|
|
|
- });
|
|
|
+ function handleNotify() {
|
|
|
+ notification.success({
|
|
|
+ message: 'Tip',
|
|
|
+ description: 'content message...',
|
|
|
+ });
|
|
|
+ }
|
|
|
</script>
|