Skip to content

InfoBox-DEMO


Default

vue
<fv-InfoBox>
</fv-InfoBox>

Error

vue
<fv-InfoBox status="error">
</fv-InfoBox>

Blocked

vue
<fv-InfoBox status="blocked">
</fv-InfoBox>

Correct

vue
<fv-InfoBox status="correct">
</fv-InfoBox>

Warning

vue
<fv-InfoBox status="warning">
</fv-InfoBox>

Without TitleBar

vue
<fv-InfoBox :showTitleBar="false">
</fv-InfoBox>

InfoBox-Dark Theme


Default

vue
<fv-InfoBox theme="dark">
</fv-InfoBox>

Error

vue
<fv-InfoBox status="error" theme="dark">
</fv-InfoBox>

Blocked

vue
<fv-InfoBox status="blocked" theme="dark">
</fv-InfoBox>

Correct

vue
<fv-InfoBox status="correct" theme="dark">
</fv-InfoBox>

Warning

vue
<fv-InfoBox status="warning" theme="dark">
</fv-InfoBox>

Without TitleBar

vue
<fv-InfoBox theme="dark" :showTitleBar="false">
</fv-InfoBox>

InfoBox-Toast


  1. Standard
vue
<fv-button style="width: 200px;" @click="show1">Show InfoBox</fv-button>
javascript
this.$infoBox('This is a toast info.', {
    status: 'correct',
    title: 'InfoBox',
    confirm: () => { alert('Confirm'); },
    cancel: () => { alert('Cancel'); }
});
  1. Customize Message Template
vue
<fv-button style="width: 200px;" @click="show2">Show InfoBox</fv-button>
javascript
this.$infoBox(h('div', [
    h('span', { class: 'header' }, 'Message'),
    'This is a toast info.',
    h('a', {
        style: {
            fontWeight: 'bold'
        }
    }, 'Visit our website.')
]), {
    status: 'correct',
    confirmTitle: 'Confirm',
    cancelTitle: 'Cancel',
    confirm: () => { alert('Confirm'); },
    cancel: () => { alert('Cancel'); }
});
  1. Customize Control Panel
vue
<fv-button style="width: 200px;" @click="show3">Show InfoBox</fv-button>
javascript
this.$infoBox(h('div', [
    h('span', { class: 'header' }, 'Message'),
    'This is a toast info.',
    h('a', {
        style: {
            fontWeight: 'bold'
        }
    }, 'Visit our website.')
]), {
    status: 'correct',
    confirmTitle: 'Confirm',
    cancelTitle: 'Cancel',
    showTitleBar: false,
    control_panel: x => {
    return h(resolveComponent('fv-button'), {
            style: {
                width: '200px'
            },
            background: x.iconList['correct'].backgroundColor,
            theme: "dark",
            onClick: () => {
                x.confirm();
            }
        }, 'Custom Control Button');
    },
    confirm: () => { alert('Confirm'); },
    cancel: () => { alert('Cancel'); }
});

Properties


PropertyTypeRequiredDefaultDescription
titlestringNo'Tip'See the InfoBox title option.
statusstringNo'default'See the InfoBox status option.
modestringNo'relative'See the InfoBox mode option.
toastBooleanNofalseSee the InfoBox toast option.
confirmTitlestringNo'确定'See the InfoBox confirmTitle option.
cancelTitlestringNo'取消'See the InfoBox cancelTitle option.
acrylicbooleanNofalseSee the InfoBox acrylic option.
showTitleBarbooleanNotrueSee the InfoBox showTitleBar option.
themestringNo'global'Theme style. Supports global, light, dark, system, and custom.
destroyNofalseSee the InfoBox destroy option.
disabledbooleanNofalseSee the InfoBox disabled option.
langstringNo"global"See the InfoBox lang option.

Events


EventArgumentsDescription
confirmSee the component confirm option.
closeSee the component close option.

Slots


  1. Msg
vue
<template v-slot:msg>
    <span>Normal content <span class="header">Header content</span><a>Link</a></span>
</template>
  1. Control Panel
vue
<template v-slot:control-panel="x">
    <fv-button :theme="'dark'" :background="x.iconList[status].backgroundColor" :isBoxShadow="true" :borderRadius="6" style="width: 50%; height: 35px; margin-right: 2.5px;" @click="x.confirm">Confirm</fv-button>
    <fv-button :theme="x.theme" :isBoxShadow="true" :borderRadius="6" style="width: 50%; height: 35px; margin-left: 2.5px;" @click="x.cancel">Cancel</fv-button>
</template>

### Toast
---

```javascript
this.$infoBox(msg, options = {
    title: 'InfoBox',
    status: 'default',
    mode: 'fixed',
    toast: true,


    acrylic: false,
    confirm: async () => {},
    cancel: async () => {},
    control_panel: null,
    theme: 'global'
});

MIT Licensed