• 首页
  • 产品中心
    • 数式Oinone四大产品

      低代码开发平台无代码开发平台集成开发平台AI大模型开发
    • 数式Oinone体系能力

      用户与组织权限管理文件管理消息中心国际化业务审计
    • 数式Oinone核心产品特性

      低无一体面向软件公司场景无限制应用级扩容可分可合
  • 服务中心
    • 客户服务

      预约演示方案咨询私有部署找人定制
    • 开发者

      问答下载
    • Oinone学院

      社区学习

    《精讲面向软件公司的低代码平台——以Oinone为例》

  • 合作伙伴
    渠道申请伙伴名录专家库
  • 关于数式
0571-88757863

Vue UI Antd


In Oinone Kunlun, most components are implemented based on the third-party component library "Ant Design Vue". These components can be used not only for Widget components, but also directly for any Vue component using Vue native writing. This article will provide a detailed introduction to the usage and API definitions of these components.

Ⅰ. Import

import { OioButton } from '@oinone/kunlun-vue-ui-antd';

Ⅱ. Reference List

(Ⅰ) General

Button

Basic Usage

<template>
  <oio-button>Default Button</oio-button>
  <oio-button type="primary">Primary Button</oio-button>
  <oio-button type="ghost">Ghost Button</oio-button>
  <oio-button type="link">Link Button</oio-button>
  <oio-button type="text">Text Button</oio-button>
</template>

Button with Icon

<template>
  <oio-button icon="oinone-sousuo" icon-placement="before">Search</oio-button>
  <oio-button icon="oinone-xiazai2" icon-placement="after">Download</oio-button>
  <oio-button icon="oinone-bianji4" type="primary">Edit</oio-button>
</template>

Business Scene Button

<template>
  <oio-button biz-style="success">Success Button</oio-button>
  <oio-button biz-style="warning">Warning Button</oio-button>
  <oio-button biz-style="danger">Danger Button</oio-button>
  <oio-button biz-style="info">Info Button</oio-button>

  <oio-button type="primary" biz-style="success">Success Button</oio-button>
  <oio-button type="primary" biz-style="warning">Warning Button</oio-button>
  <oio-button type="primary" biz-style="danger">Danger Button</oio-button>
  <oio-button type="primary" biz-style="info">Info Button</oio-button>
</template>

Loading State and Selected State

<template>
  <oio-button async @click="onSubmit1">Built-in Loading State</oio-button>
  <oio-button :loading="loading" @click="onSubmit2">Control Loading State with loading Parameter</oio-button>
</template>
<script lang="ts">
import { OioButton } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioButton
  },
  props: {},
  setup(props) {
    const loading = ref(false);

    const onSubmit1 = () => {
      return new Promise((resolve) => {
        setTimeout(() => {
          resolve();
        }, 1000);
      });
    };

    const onSubmit2 = () => {
      loading.value = true;
      setTimeout(() => {
        loading.value = false;
      }, 1000);
    };

    return {
      loading,
      onSubmit1,
      onSubmit2
    };
  }
});
</script>

API

Props

PropertyTypeDefaultDescription
typeButtonType(default/primary/ghost/link/text)defaultButton type
bizStyleButtonBizStyle(default/success/warning/danger/info)defaultBusiness scene style
htmlTypestringbuttonNative HTML type (e.g., submit/reset)
sizeButtonSize(large/middle/small)middleButton size
blockbooleanfalseWhether to be a block-level button (occupy full parent width)
ghostbooleanfalseWhether to be a ghost button (transparent background)
dangerbooleanfalseWhether to be a danger button (red warning)
hrefstring-Link address (converted to <a> tag, higher priority than onClick)
targetstring_selfLink opening method (e.g., _blank/_parent)
asyncbooleanfalseWhether to enable async mode (automatically handle loading state)
loadingbooleanundefinedLoading state (true to show loading icon, undefined to use internal state)
disabledbooleanundefinedDisabled state
iconstring-Icon name (e.g., search/download, requires OioIcon component)
iconPlacementIconPlacement(before/after)beforeIcon position (before / after)
selectedbooleanundefinedSelected state (only valid for type="link")

Events

EventParametersDescription
update:loadingloading: booleanFired when loading state changes (for two-way binding)
update:selectedselected: booleanFired when selected state changes (for two-way binding)
clickevent: MouseEventClick event (async mode automatically closes loading state after async operation completes)

Slots

SlotDescription
defaultButton main content
iconCustom icon (higher priority than icon
prop)

(Ⅱ) Layout

Divider

Basic Usage

<template>
  <!-- Horizontal Divider -->
  <oio-divider />
  <!-- Horizontal Divider with Text (Centered) -->
  <oio-divider>Main Content</oio-divider>
</template>

Dashed Divider

<template>
  <oio-divider dashed />
  <oio-divider dashed>Dashed Style</oio-divider>
</template>

Divider with Text Aligned Left/Right

<template>
  <oio-divider orientation="left">Left Title</oio-divider>
  <oio-divider orientation="right">Right Description</oio-divider>
</template>

Vertical Divider

<template>
  <div style="display: flex; column-gap: 16px; align-items: center">
    <span>Item 1</span>
    <oio-divider type="vertical" />
    <span>Item 2</span>
    <oio-divider type="vertical" />
    <span>Item 3</span>
  </div>
</template>

API

Props

PropertyTypeDefaultDescription
typeDividerType(horizontalvertical)horizontal
dashedbooleanfalseWhether to use dashed style
plainbooleanfalseWhether to use plain style (text without background)
orientationDividerOrientation(centerleftright)

Slots

SlotDescription
defaultText or custom content in the middle of the divider (such as icons, components, etc.)

Grid

Basic Usage

<template>
  <oio-row>
    <oio-col :span="8">Column 1</oio-col>
    <oio-col :span="8">Column 2</oio-col>
    <oio-col :span="8">Column 3</oio-col>
  </oio-row>
</template>

Layout with Gutter

<template>
  <oio-row :gutter="16">
    <oio-col :span="8">Gutter 16</oio-col>
    <oio-col :span="8">Gutter 16</oio-col>
    <oio-col :span="8">Gutter 16</oio-col>
  </oio-row>
</template>

Wrap Layout

<template>
  <oio-row gutter="16" wrap>
    <oio-col :span="6" v-for="i in 5" :key="i">Wrap Item {{ i }}</oio-col>
  </oio-row>
</template>

API

oio-row

Props

PropertyTypeDefaultDescription
gutterCommonGutterType(numberstringarray
alignFlexRowAlign(top/middle/bottom/baseline/stretch)-Cross-axis alignment (vertical direction)
justifyFlexRowJustify(start/end/center/space-between/space-around)-Main-axis alignment (horizontal direction)
wrapbooleanfalseWhether to allow column wrapping

Slots

SlotDescription
defaultRow content, including grid column components
oio-col

Props

PropertyTypeDefaultDescription
flexstringnumber-
offsetnumber-Number of grid columns to offset
ordernumber-Column sorting order
pullnumber-Number of grid columns to pull left
pushnumber-Number of grid columns to push right
spannumber-Number of grid columns occupied (1-24)
xsnumberobject-
smnumberobject-
mdnumberobject-
lgnumberobject-
xlnumberobject-
xxlnumberobject-
fixedbooleanfalseWhether to be a fixed column, adding special style class

Slots

SlotDescription
defaultColumn content

Block

Basic Layout

<template>
  <oio-block>
    <div>This is a piece of content</div>
  </oio-block>
</template>

Inline Layout

<template>
  <oio-block>
    <oio-block inline>Inline Item 1</oio-block>
    <oio-block inline>Inline Item 2</oio-block>
  </oio-block>
</template>

Flex Layout (Row Direction)

<template>
  <oio-block flex>
    <div>Item 1</div>
    <div>Item 2</div>
  </oio-block>
</template>

Flex Layout (Column Direction)

<template>
  <oio-block flex flex-direction="column">
    <div>Item 1</div>
    <div>Item 2</div>
  </oio-block>
</template>

Flex Layout with Gutter

<template>
  <oio-block flex gutter="16">
    <div>Item 1</div>
    <div>Item 2</div>
  </oio-block>
</template>

API

Props

PropertyTypeDefaultDescription
inlinebooleanfalseWhether to be an inline element (inline-block or inline-flex)
flexbooleanfalseWhether to enable flex layout (display: flex)
flexDirectionFlexDirection(Row/RowReverse/Column/ColumnReverse)FlexDirection.RowMain axis direction of the flex container
gutterstringnumberStandardGutterType([number, number])

(Ⅲ) Navigation

Breadcrumb

Basic Usage

<template>
  <oio-breadcrumb>
    <oio-breadcrumb-item>Home</oio-breadcrumb-item>
    <oio-breadcrumb-item>Category</oio-breadcrumb-item>
    <oio-breadcrumb-item>Product Details</oio-breadcrumb-item>
  </oio-breadcrumb>
</template>

Custom Separator

<template>
  <oio-breadcrumb separator=">">
    <oio-breadcrumb-item>Home</oio-breadcrumb-item>
    <oio-breadcrumb-item>Category</oio-breadcrumb-item>
    <oio-breadcrumb-item>Product Details</oio-breadcrumb-item>
  </oio-breadcrumb>
</template>

API

oio-breadcrumb

Props

PropertyTypeDefaultDescription
separatorstring'/'Global separator

Slots

SlotDescription
defaultBreadcrumb navigation content
separatorCustom separator (higher priority than props)
itemRenderCustom list item rendering
oio-breadcrumb-item

Props

PropertyTypeDefaultDescription
separatorstring'/'Individual list item separator (higher priority than parent component)

Slots

SlotDescription
defaultList item content
separatorCustom separator for the current item
overlayAdditional content for the list item (such as a hover layer)

Dropdown

For usage examples and API, please refer to: Antd Dropdown for Vue

Only Apply Oinone Theme Style

<template>
  <a-dropdown class="oio-dropdown" overlay-class-name="oio-dropdown-overlay" />
</template>

Pagination

Basic Usage

<template>
  <oio-pagination
    :total="total"
    v-model:current-page="currentPage"
  />
</template>

Customize Items per Page

<template>
  <oio-pagination
    :total="total"
    v-model:current-page="currentPage"
    v-model:page-size="pageSize"
    :page-size-options="[20, 50, 100]"
  />
</template>

Show Total and Quick Jump

<template>
  <oio-pagination
    :total="total"
    v-model:current-page="currentPage"
    show-total
    show-jumper
  />
</template>

API

Props

PropertyTypeDefaultDescription
currentPagenumber-Current page number (controlled mode)
defaultCurrentPagenumber1Default page number (uncontrolled mode)
pageSizenumber-Items per page (controlled mode)
defaultPageSizenumber15Default items per page (uncontrolled mode)
pageSizeOptions(numberstring)[][10, 15, 30, 50, 100, 200]
totalnumber0Total number of data
showSizeChangerbooleantrueWhether to show items per page selector
showTotalboolean((total: number, range) => string)false
showJumperbooleanfalseWhether to show quick jump
disabledbooleanfalseWhether to disable pagination
showLastPagebooleantrueWhether to show complete pagination (otherwise show simplified version)

Events

EventParametersDescription
update:current-pagecurrentPage: numberFired when current page changes
update:page-sizepageSize: numberFired when items per page changes
changecurrentPage: number, pageSize: numberFired when page number or items per page changes

Slots

SlotParametersDescription
pageSizeOptionCustom display content for items per page selector

(Ⅳ) Data Entry

Cascader

Basic Usage

<template>
  <oio-cascader v-model:value="selected" :options="options" placeholder="Please select cascade items" />
</template>
<script lang="ts">
import { OioCascader } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

interface Option {
  key: string;
  value: string;
  label: string;
  isLeaf: boolean;
  children?: Option[];
}

export default defineComponent({
  components: {
    OioCascader
  },
  props: {},
  setup(props) {
    const selected = ref();

    const options = ref<Option[]>([
      {
        key: '1',
        value: 'a',
        label: 'a',
        isLeaf: false,
        children: [
          {
            key: '1-1',
            value: 'a-1',
            label: 'a-1',
            isLeaf: true
          },
          {
            key: '1-2',
            value: 'a-2',
            label: 'a-2',
            isLeaf: true
          }
        ]
      },
      {
        key: '2',
        value: 'b',
        label: 'b',
        isLeaf: true
      }
    ]);

    return {
      selected,
      options
    };
  }
});
</script>

Asynchronous Loading of Cascade Data

<template>
  <oio-cascader v-model:value="selected" :options="options" placeholder="Please select cascade items" :load-data="loadData" />
</template>
<script lang="ts">
import { CascaderItem, OioCascader } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

interface Option {
  key: string;
  value: string;
  label: string;
  isLeaf: boolean;
  loaded?: boolean;
  children?: Option[];
}

export default defineComponent({
  components: {
    OioCascader
  },
  props: {},
  setup(props) {
    const selected = ref();

    const options = ref<Option[]>([
      {
        key: '1',
        value: 'a',
        label: 'a',
        isLeaf: false
      },
      {
        key: '2',
        value: 'b',
        label: 'b',
        isLeaf: false
      }
    ]);

    const loadData = (selectedOptions: CascaderItem<Option>[]) => {
      const selectedOption = selectedOptions[selectedOptions.length - 1].data;
      if (!selectedOption.loaded) {
        selectedOption.loaded = true;
        setTimeout(() => {
          selectedOption.children = [
            {
              key: `${selectedOption.key}-1`,
              value: `${selectedOption.value}-1`,
              label: `${selectedOption.label}-1`,
              isLeaf: true
            },
            {
              key: `${selectedOption.key}-2`,
              value: `${selectedOption.value}-2`,
              label: `${selectedOption.label}-2`,
              isLeaf: true
            }
          ];
        }, 1000);
      }
    };
    return {
      selected,
      options,
      loadData
    };
  }
});
</script>

Custom Display Content

<template>
  <oio-cascader
    v-model:value="selected"
    :options="options"
    placeholder="Please select cascade items"
    :display-render="displayRender"
  />
</template>
<script lang="ts">
import { OioCascader } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

interface Option {
  key: string;
  value: string;
  label: string;
  isLeaf: boolean;
  children?: Option[];
}

export default defineComponent({
  components: {
    OioCascader
  },
  props: {},
  setup(props) {
    const selected = ref();

    const options = ref<Option[]>([
      {
        key: '1',
        value: 'a',
        label: 'a',
        isLeaf: false,
        children: [
          {
            key: '1-1',
            value: 'a-1',
            label: 'a-1',
            isLeaf: true
          },
          {
            key: '1-2',
            value: 'a-2',
            label: 'a-2',
            isLeaf: true
          }
        ]
      },
      {
        key: '2',
        value: 'b',
        label: 'b',
        isLeaf: true
      }
    ]);

    const displayRender = ({ labels }: { labels: string[] }) => {
      return labels.join(' > ');
    };

    return {
      selected,
      options,
      displayRender
    };
  }
});
</script>

API

Props

PropertyTypeDefaultDescription
modeSelectMode(single/multiple)singleSelection mode (single / multiple)
valuestring[]string[][]undefined
optionsCascaderItem[][]Cascade data options
filterOption(inputValue, option) => booleanundefinedSearch filter function
propertiesCascaderProperties{}Cascade data property mapping (such as childrenProp
/isLeafProp
)
customFillProperties(option: CascaderItem<T>, index: number) => CascaderItem<T>undefinedCustom data filling function
labelsSeparatorstring' / 'Cascade label separator
displayRenderCascaderDisplayRenderFunctionAuto-splice labelsCustom display content rendering function
tagRenderFunctionundefinedTag rendering function in multiple selection mode
maxTagCountnumber'responsive''responsive'
maxTagPlaceholderstringFunction'More tags'
multipleCheckedStrategyCascaderCheckedStrategy(SHOW_ALL/SHOW_CHILD/SHOW_PARENT)SHOW_CHILDSelection strategy in multiple selection mode
loadingbooleanundefinedLoading state
loadData(selectedOptions: CascaderItem[]) => voidundefinedAsynchronous data loading function
autofocusbooleanfalseWhether to autofocus
placeholderstring'Please select'Placeholder text
allowClearbooleanfalseWhether to show clear button
readonlybooleanfalseWhether to be in read-only state
disabledbooleanundefinedWhether to disable
searchValuestringundefinedSearch input value
enableSearchbooleanundefinedWhether to enable search function
dropdownClassNamestringstring[]undefined
getTriggerContainer`(triggerNode: NodeHTMLElement) => NodeHTMLElement`
changeOnSelectbooleanfalseWhether to immediately trigger change event when selecting a child item in single selection mode

Events

EventParametersDescription
update:valuevalues: string[]string[][]
changevalues: string[]string[][], selectedOptions: CascaderItem[][]
searchsearchValue: stringFired when search input changes

Checkbox

Basic Usage

<template>
  <oio-checkbox v-model:checked="checked">Agree</oio-checkbox>
</template>

Intermediate State

<template>
  <oio-checkbox indeterminate>Partially Selected</oio-checkbox>
</template>

Readonly and Disabled States

<template>
  <oio-checkbox checked readonly>Readonly State (Checked)</oio-checkbox>
  <oio-checkbox readonly>Readonly State (Unchecked)</oio-checkbox>
  <oio-checkbox checked disabled>Disabled State (Checked)</oio-checkbox>
  <oio-checkbox disabled>Disabled State (Unchecked)</oio-checkbox>
</template>

API

Props

PropertyTypeDefaultDescription
autofocusbooleanfalseWhether to autofocus
indeterminatebooleanundefinedHalf-selected state (intermediate state)
checkedbooleanundefinedSelected state (two-way binding)
readonlybooleanfalseWhether to be in read-only state
disabledbooleanfalseWhether to disable

Events

EventParametersDescription
update:checkedchecked: booleanFired when selected state changes (for two-way binding)
changechecked: booleanFired when selected state changes

DatePicker

Basic Usage

<template>
  <oio-date-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-date-picker
    class="oio-date-time-picker"
    dropdown-class-name="oio-date-time-picker-popper"
    v-model:value="value"
  />
</template>

For more usage, please refer to: Antd DatePicker for Vue

API

Props

PropertyTypeDefaultDescription
placeholderstringMode-related default copyInput box placeholder text
readonlybooleanfalseWhether to be in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (e.g., YYYY-MM-DD)
valueFormatstringYYYY-MM-DDValue format (for two-way binding)
allowClearbooleantrueWhether to show clear button
openbooleanundefinedControl pop-up display (controlled mode)
changeOpenValuefunction-Callback when pop-up display state changes
localeobject-Internationalization configuration (e.g., week, month names)
dropdownClassNamestringstring[]-
openPanelChangefunction-Callback when pop-up opens
closePanelChangefunction-Callback when pop-up closes
getTriggerContainerfunction() => document.bodyPop-up mounting parent node
showTodaybooleantrueWhether to show "Today" button
valueDatestring-
defaultValueDatestring-
disabledDate(date) => boolean-Disabled date judgment function

Events

EventParametersDescription
update:valuevalue: stringFired when selected value changes (two-way binding)

Slots

SlotParametersDescription
dateRenderCustom date cell content
renderExtraFooter-Custom pop-up footer content

DateRangePicker

Basic Usage

<template>
  <oio-date-range-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-range-picker
    class="oio-date-time-range-picker oio-date-time-picker-range-date"
    dropdown-class-name="oio-date-time-range-picker-popper oio-date-time-range-picker-popper-date"
    v-model:value="value"
  />
</template>

For more usage, please refer to: Antd DatePicker for Vue

API

Props

PropertyTypeDefaultDescription
placeholder[string, string]Mode-related default copyInput box placeholder text (start and end)
readonlybooleanfalseWhether to be in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (e.g., YYYY-MM-DD)
valueFormatstringYYYY-MM-DDValue format (for two-way binding)
allowClearbooleantrueWhether to show clear button
dropdownClassNamestringstring[]-
separatorstring~Separator between start and end values
openPanelChangefunction-Callback when pop-up opens
closePanelChangefunction-Callback when pop-up closes
getTriggerContainerfunction() => document.bodyPop-up mounting parent node
value[Datestringundefined, Date
defaultValue[Datestringundefined, Date

Events

EventParametersDescription
update:value[start: string, end: string]Fired when selected value changes (two-way binding)

DateTimePicker

Basic Usage

<template>
  <oio-date-time-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-date-picker
    class="oio-date-time-picker"
    dropdown-class-name="oio-date-time-picker-popper"
    show-time
    v-model:value="value"
  />
</template>

For more usage, please refer to: Antd DatePicker for Vue

API

Props

PropertyTypeDefaultDescription
placeholderstringMode-related default copyInput box placeholder text
readonlybooleanfalseWhether to be in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (e.g., YYYY-MM-DD HH:mm:ss)
valueFormatstringYYYY-MM-DD HH:mm:ssValue format
allowClearbooleantrueWhether to show clear button
openbooleanundefinedControl pop-up display (controlled mode)
changeOpenValuefunction-Callback when pop-up display state changes
localeobject-Internationalization configuration (e.g., week, month names)
dropdownClassNamestringstring[]-
openPanelChangefunction-Callback when pop-up opens
closePanelChangefunction-Callback when pop-up closes
getTriggerContainerfunction() => document.bodyPop-up mounting parent node
showTodaybooleantrueWhether to show "Today" button
valueDatestring-
defaultValueDatestring-
disabledDate(date) => boolean-Disabled date judgment function
disabledTime(date) => { disabledHours: number[]; disabledMinutes: number[]; disabledSeconds: number[] }-Disabled time configuration (function or object)

Events

EventParametersDescription
update:valuevalue: stringFired when selected value changes (two-way binding)

Slots

SlotParametersDescription
dateRenderCustom date cell content
renderExtraFooter-Custom pop-up footer content

DateTimeRangePicker

Basic Usage

<template>
  <oio-date-time-range-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-range-picker
    class="oio-date-time-range-picker oio-date-time-picker-range-datetime"
    dropdown-class-name="oio-date-time-range-picker-popper oio-date-time-range-picker-popper-datetime"
    show-time
    v-model:value="value"
  />
</template>

For more usage, please refer to: Antd DatePicker for Vue

API

Props

PropertyTypeDefaultDescription
placeholder[string, string]Mode-related default copyInput box placeholder text (start and end)
readonlybooleanfalseWhether to be in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (e.g., YYYY-MM-DD HH:mm:ss)
valueFormatstringYYYY-MM-DD HH:mm:ssValue format (for two-way binding)
allowClearbooleantrueWhether to show clear button
dropdownClassNamestringstring[]-
separatorstring~Separator between start and end values
openPanelChangefunction-Callback when pop-up opens
closePanelChangefunction-Callback when pop-up closes
getTriggerContainerfunction() => document.bodyPop-up mounting parent node
value[Datestringundefined, Date
defaultValue[Datestringundefined, Date

Events

EventParametersDescription
update:value[start: string, end: string]Fired when selected value changes (two-way binding)

Form

Basic Usage

<template>
  <oio-form :data="data" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
    <oio-form-item label="Username" name="username" :rules="[{ required: true, message: 'Please enter username' }]">
      <oio-input v-model:value="data.username" />
    </oio-form-item>
    <oio-form-item label="Password" name="password" :rules="[{ required: true, message: 'Please enter password' }]">
      <oio-input-password v-model:value="data.password" />
    </oio-form-item>
  </oio-form>
</template>
<script lang="ts">
import { OioForm, OioFormItem, OioInput, OioInputPassword } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioForm,
    OioFormItem,
    OioInput,
    OioInputPassword
  },
  props: {},
  setup(props) {
    const data = ref({
      username: '',
      password: ''
    });

    return {
      data
    };
  }
});
</script>

Only Apply Oinone Theme Style

<template>
  <a-form class="oio-form" :model="data" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" autocomplete="off">
    <a-form-item
      class="oio-form-item oio-form-item-horizontal"
      label="Username"
      name="username"
      :rules="[{ required: true, message: 'Please input your username!' }]"
    >
      <a-input class="oio-input" v-model:value="data.username" />
    </a-form-item>
    <a-form-item
      class="oio-form-item oio-form-item-horizontal"
      label="Password"
      name="password"
      :rules="[{ required: true, message: 'Please input your password!' }]"
    >
      <a-input-password class="oio-input oio-input-password" v-model:value="data.password" />
    </a-form-item>
  </a-form>
</template>

For more usage, please refer to: Antd Form for Vue

API

oio-form

Props

PropertyTypeDefaultDescription
namestring-Form name
rulesRecord<string, FormItemRule[]>-Form validation rules
layoutFormLayout(horizontalverticalinline)
labelColOioColModel-Label column grid configuration (for horizontal layout only)
wrapperColOioColModel-Content column grid configuration (for horizontal layout only)
labelAlignFormLabelAlign(leftright)left
colonbooleanfalseWhether to show label colon
validateTriggerValidateTriggerValidateTrigger[]['change', 'blur']
validateOnRuleChangebooleantrueWhether to trigger validation when rules change
loadingbooleanundefinedWhether to show loading state (inherited from OioSpin)
loadingIndicatorVNode-Custom loading icon
wrapperClassNamestringstring[]-
dataobject-Form data model

Events

EventParametersDescription
submitEventForm submission event (triggered via <form> tag)

Methods

MethodParametersDescription
validatenames?: NamePathValidate specified fields, return Promise
validateFieldsnames?: NamePathValidate all fields, return Promise
resetFieldsnames?: NamePathReset specified field values and validation status
clearValidatenames?: NamePathClear validation status of specified fields
scrollToFieldnames?: NamePathScroll to specified field position
oio-form-item

Props

PropertyTypeDefaultDescription
namestring-Field name (for form validation and data binding)
rulesFormItemRule[]FormItemRule-
autoLinkbooleantrueWhether to automatically associate label and input's for attribute
colonbooleanfalseWhether to show label colon (higher priority than form-level configuration)
htmlForstring-id of the input associated with the label
labelColOioColModel-Label column grid configuration (only valid for horizontal layout)
wrapperColOioColModel-Content column grid configuration (only valid for horizontal layout)
labelAlignFormLabelAlign(leftright)-
labelstring-Label text
extrastring-Field extra description text
helpstring-Field help text
requiredboolean-Whether to be required (automatically generates asterisk)
disabledboolean-Whether to disable the field
validateStatusstring-Validation status (success/warning/error/validating)
validateFirstboolean-Whether to validate the first error rule first
validateTrigger`(stringValidateTrigger)[]`['change', 'blur']
layoutFormLayout(horizontalverticalinline)

Slots

SlotParametersDescription
default-Field content (such as input boxes, selectors, etc.)
label-Custom label content
extra-Custom extra description content
help-Custom help text

Input

Basic Usage

<template>
  <oio-input v-model:value="value" placeholder="Please enter" />
</template>

With Clear Icon

<template>
  <oio-input v-model:value="value" placeholder="Please enter" allow-clear />
</template>

Prefix and Suffix

<template>
  <oio-input v-model:value="value" placeholder="Please enter">
    <template #prefix>
      <oio-icon icon="oinone-a-zhanghaodenglu4x" />
    </template>
    <template #suffix>
      <oio-tooltip title="Extended Information">
        <oio-icon icon="oinone-wenhao1" />
      </oio-tooltip>
    </template>
  </oio-input>
  <oio-input v-model:value="value" placeholder="Please enter" prefix="¥" suffix="RMB" />
</template>

Number Input

<template>
  <oio-input-number v-model:value="value" placeholder="Please enter" />
</template>

Password Input

<template>
  <oio-input-password v-model:value="value" placeholder="Please enter" />
</template>

Search Input

<template>
  <oio-input-search v-model:value="value" placeholder="Please enter" @search="onSearch" />
</template>
<script lang="ts">
import { InputSearchEvent, OioInputSearch } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioInputSearch
  },
  props: {},
  setup(props) {
    const value = ref();

    const onSearch = (e: InputSearchEvent) => {
      console.log(e.value);
    };

    return {
      value,
      onSearch
    };
  }
});
</script>

Input Group

<template>
  <oio-input-group compact>
    <oio-input v-model:value="value1" style="flex: 1" />
    <oio-input v-model:value="value2" style="flex: 2" />
  </oio-input-group>
  <oio-input-group compact>
    <a-select class="oio-select" dropdown-class-name="oio-select-dropdown" style="flex: 1" v-model:value="value3">
      <a-select-option value="Zhejiang">Zhejiang</a-select-option>
      <a-select-option value="Jiangsu">Jiangsu</a-select-option>
    </a-select>
    <oio-input v-model:value="value4" style="flex: 2" />
  </oio-input-group>
</template>

Only Apply Oinone Theme Style

<template>
  <!-- Basic Usage -->
  <a-input class="oio-input" v-model:value="value" placeholder="Please enter" />
  <!-- With Clear Icon -->
  <a-input class="oio-input oio-input-allow-clear" v-model:value="value" placeholder="Please enter" allow-clear />
  <!-- Number Input -->
  <a-input-number class="oio-input-number" v-model:value="value" placeholder="Please enter" />
  <!-- Password Input -->
  <a-input-password class="oio-input oio-input-password" v-model:value="value" placeholder="Please enter" />
</template>

For more usage, please refer to: Antd Input for Vue

API

oio-input

Props

PropertyTypeDefaultDescription
valuestring-Input box value (two-way binding)
defaultValuestring-Default value of the input box
placeholderstring-Placeholder text
disabledbooleanfalseWhether to disable the input box
allowClearbooleanfalseWhether to show clear button
maxlengthnumber-Maximum input length
autocompletebooleanstringundefined
showCountbooleanfalseWhether to show character count, requires配合 maxlength use
readonlybooleanfalseWhether to be in read-only state
minlengthnumber-Minimum input length
autofocusbooleanundefinedWhether to autofocus, takes effect after component mounting

Events

EventParametersDescription
update:valuevalue: stringundefined
press-enterevent: KeyboardEventFired when Enter key is pressed

Slots

SlotDescription
prependInput box prefix content, displayed before the input box
appendInput box suffix content, displayed after the input box
prefixInput box prefix icon/content, displayed inside the input box on the left
suffixInput box suffix icon/content, displayed inside the input box on the right

Methods

MethodParametersDescription
focusoptions?: FocusOptionsFocus the input box, can pass focus options (such as preventScroll)
blur-Remove focus from the input box
oio-input-number

Props

PropertyTypeDefaultDescription
valuenumberstring-
defaultValuenumberstring-
placeholderstring-Input box placeholder text
readonlybooleanfalseWhether to be in read-only mode (non-editable)
disabledbooleanfalseWhether to disable the input box
formatter(value: string) => string-Format display value (prior to showThousandth)
parser(value: string) => string-Parse input value (process formatted value)
minnumberstring-
maxnumberstring-
stepnumberstring1
addStepnumberstringstep
reduceStepnumberstringstep
precisionnumber-Number of decimal places to retain (automatically rounded, e.g., 2 for two decimal places)
unitstring-Input box suffix unit (e.g., "Yuan" "%" )
hiddenStepHandlebooleanfalseWhether to hide up/down arrow buttons
showThousandthbooleanfalseWhether to show thousandth separators (e.g., 1,000.5 )
autocorrectionbooleanfalseWhether to automatically correct the value when blurring (correct to within min/max range)

Events

EventParametersDescription
update:valuevalue: stringFired when value changes (two-way binding)
focusevent: FocusEventFired when input box gains focus
blurevent: FocusEventFired when input box loses focus

Slots

SlotParametersDescription
prepend-Input box prefix content (such as icons)
append-Input box suffix content (such as units)
prefix-Input box prefix (inside the input box on the left)
suffix-Input box suffix (inside the input box on the right)

Methods

MethodParametersDescription
getRealValue-Get internal real value (BigNumber
type)
setValueval: numberstring
autocorrection-Manually trigger auto-correction (return corrected value)
oio-input-password

Props

PropertyTypeDefaultDescription
valuestring-Input box value (two-way binding)
defaultValuestring-Default value of the input box
placeholderstring-Placeholder text
disabledbooleanfalseWhether to disable the input box
allowClearbooleanfalseWhether to show clear button
maxlengthnumber-Maximum input length
autocompletebooleanstring'new-password'
showCountbooleanfalseWhether to show character count
readonlybooleanfalseWhether to be in read-only state
minlengthnumber-Minimum input length
autofocusboolean-Whether to autofocus after component mounting
showPasswordbooleantrueWhether to show button to toggle password visibility

Events

EventParametersDescription
update:valuestringundefined

Slots

SlotDescription
prependInput box prefix content
appendInput box suffix content
prefixInput box prefix content
oio-input-search

Props

PropertyTypeDefaultDescription
typeInputTypeInputType.TEXTInput box type, optional values: TEXT, PASSWORD
valuestring-Input box value (two-way binding)
defaultValuestring-Default value of the input box
placeholderstring-Placeholder text
disabledbooleanfalseWhether to disable the input box
allowClearbooleanfalseWhether to show clear button
maxlengthnumber-Maximum input length
autocompletebooleanstring'new-password'
showCountbooleanfalseWhether to show character count
readonlybooleanfalseWhether to be in read-only state
minlengthnumber-Minimum input length
autofocusboolean-Whether to autofocus after component mounting

Events

EventParametersDescription
update:valuestringundefined
searchInputSearchEventFired when search button is clicked or Enter key is pressed

Slots

SlotDescription
prependInput box prefix content (left side)
appendInput box suffix content (right side)
prefixInput box prefix icon/content
suffixInput box suffix icon/content
enterCustom search button content
oio-input-group

Props

PropertyTypeDefaultDescription
compactbooleantrueWhether to use compact mode for the input group

Slots

Slot NameDescription
defaultUsed to place the input box component

Select Selection Box

Only Apply Oinone Theme Style

<template>
  <a-select class="oio-select" dropdown-class-name="oio-select-dropdown" />
</template>

For more usage methods, please refer to: Antd Select Selection Box For Vue

Slider Slider Input

Basic Usage

<template>
  <oio-slider v-model:value="value" />
</template>

Vertical

<template>
  <div style="height: 300px">
    <oio-slider v-model:value="value" direction="vertical" />
  </div>
</template>

Only Apply Oinone Theme Style

<template>
  <!-- Basic Usage -->
  <a-slider class="oio-slider" v-model:value="value" :min="0" :max="100" :step="1" />
  <!-- Vertical -->
  <div style="height: 300px">
    <a-slider class="oio-slider" v-model:value="value" :min="0" :max="100" :step="1" vertical />
  </div>
</template>

For more usage methods, please refer to: Antd Slider Slider Input For Vue

API

Props

Parameter NameTypeDefault ValueDescription
valuenumbernumber[]-
defaultValuenumbernumber[]-
readonlybooleanfalseWhether it is in read-only state
disabledbooleanfalseWhether to disable the slider
minnumber0Minimum value
maxnumber100Maximum value
stepnumber1Step size (the value must be a factor of (max - min))
directionSliderDirection'horizontal''vertical'
marks{ [key: number]: stringVNode{ style?: CSSStyleDeclaration; label: string
dotsbooleanfalseWhether to display scale points
reversebooleanfalseWhether to slide in reverse
rangebooleanfalseWhether to enable range selection mode
tooltipVisiblebooleanundefinedWhether to display the tooltip (default follows interaction status)
tooltipPlacementOioTooltipPlacement-Tooltip position, optional values see enum OioTooltipPlacement
tooltipFormatter(value: number) => string-Tooltip content formatting function
getTooltipTriggerContainer`(triggerNode: NodeHTMLElement) => NodeHTMLElement`

Events

Event NameParametersDescription
update:valuenumbernumber[]

Switch Toggle

Basic Usage

<template>
  <oio-switch v-model:value="value" />
</template>

Toggle with Text

<template>
  <oio-switch v-model:checked="value" checked-children="On" unchecked-children="Off" />
  <oio-switch v-model:checked="value">
    <template #checkedChildren>On</template>
    <template #uncheckedChildren>Off</template>
  </oio-switch>
</template>

Custom Toggle Values

<template>
  <oio-switch v-model:checked="value" :checked-value="1" :unchecked-value="0" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-switch class="oio-switch" v-model:checked="value" />
</template>

For more usage methods, please refer to: Antd Switch Toggle For Vue

API

Props

Parameter NameTypeDefault ValueDescription
autofocusbooleanfalseWhether to automatically focus after component mounting
checkedbooleanstringnumber
loadingbooleanfalseWhether to display the loading state
sizeSwitchSize'default'Toggle size, optional values: 'default', 'small'
disabledbooleanfalseWhether to disable the toggle
checkedValuebooleanstringnumber
uncheckedValuebooleanstringnumber
readonlybooleanfalseWhether it is in read-only state

Events

Event NameParametersDescription
update:checkedbooleanTriggered when the toggle state changes (two-way binding)
changebooleanTriggered when the toggle state changes

Slots

Slot NameDescription
checkedChildrenContent displayed when the toggle is on
uncheckedChildrenContent displayed when the toggle is off

Textarea Multiline Input

Basic Usage

<template>
  <oio-textarea v-model:value="value" placeholder="Please enter" />
</template>

With Remove Icon

<template>
  <oio-textarea v-model:value="value" placeholder="Please enter" allow-clear />
</template>

Only Apply Oinone Theme Style

<template>
  <!-- Basic Usage -->
  <a-textarea v-model:value="value" placeholder="Please enter" />
  <!-- With Remove Icon -->
  <a-textarea class="oio-textarea oio-textarea-allow-clear" v-model:value="value" placeholder="Please enter" allow-clear />
</template>

For more usage methods, please refer to: Antd Input Input Box For Vue

API

Props

Parameter NameTypeDefault ValueDescription
valuestring-Current value of the textarea (two-way binding)
defaultValuestring-Initial value
placeholderstring-Placeholder text
disabledbooleanfalseWhether to disable the textarea
allowClearbooleanfalseWhether to display the clear button
maxlengthnumber-Maximum number of input characters
autoSizebooleanTextareaSizefalse
showCountbooleanfalseWhether to display the character count
readonlybooleanfalseWhether it is in read-only state
minlengthnumber-Minimum number of input characters

Events

Event NameParametersDescription
update:valuestringundefined
changestringundefined

Methods

Method NameParametersDescription
focus-Make the textarea gain focus
blur-Make the textarea lose focus

TimePicker Time Picker

Basic Usage

<template>
  <oio-time-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-time-picker
    class="oio-date-time-picker"
    popup-class-name="oio-date-time-picker-popper"
    v-model:value="value"
  />
</template>

For more usage methods, please refer to: Antd TimePicker Time Picker For Vue

API

Props

Attribute NameTypeDefault ValueDescription
placeholderstringDefault copy related to the modeInput box placeholder text
readonlybooleanfalseWhether it is in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (such as HH:mm:ss)
valueFormatstringHH:mm:ssValue format
allowClearbooleantrueWhether to display the clear button
openbooleanundefinedControl the pop-up layer display (controlled mode)
changeOpenValuefunction-Callback when the pop-up layer display status changes
localeobject-Internationalization configuration (such as week, month names)
dropdownClassNamestringstring[]-
openPanelChangefunction-Callback when the pop-up layer opens
closePanelChangefunction-Callback when the pop-up layer closes
getTriggerContainerfunction() => document.bodyParent node where the pop-up layer is mounted
valueDatestring-
defaultValueDatestring-
disabledTime(date) => { disabledHours: number[]; disabledMinutes: number[]; disabledSeconds: number[] }-Disabled time configuration (function or object)

TimeRangePicker Time Range Picker

Basic Usage

<template>
  <oio-time-range-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-time-range-picker
    class="oio-date-time-range-picker oio-date-time-picker-range-time"
    popup-class-name="oio-date-time-range-picker-popper oio-date-time-range-picker-popper-time"
    v-model:value="value"
  />
</template>

For more usage methods, please refer to: Antd TimePicker Time Picker For Vue

API

Props

Attribute NameTypeDefault ValueDescription
placeholder[string, string]Default copy related to the modeInput box placeholder text (start and end)
readonlybooleanfalseWhether it is in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (such as YYYY-MM-DD HH:mm:ss)
valueFormatstringYYYY-MM-DD HH:mm:ssValue format (used for two-way binding)
allowClearbooleantrueWhether to display the clear button
dropdownClassNamestringstring[]-
separatorstring~Separator between start and end values
openPanelChangefunction-Callback when the pop-up layer opens
closePanelChangefunction-Callback when the pop-up layer closes
getTriggerContainerfunction() => document.bodyParent node where the pop-up layer is mounted
value[Datestringundefined, Date
defaultValue[Datestringundefined, Date

Events

Event NameParametersDescription
update:value[start: string, end: string]Triggered when the selected value changes (two-way binding)

TreeSelect Tree Selection

Only Apply Oinone Theme Style

<template>
  <a-tree-select
    class="oio-select oio-tree-select"
    dropdown-class-name="oio-select-dropdown oio-tree-select-dropdown"
  />
</template>

For more usage methods, please refer to: Antd Tree Select Tree Selection For Vue

Upload Upload

Basic Usage

<template>
  <oio-upload :upload-list="fileList" @success="onSuccess" @failure="onFailure">
    <oio-button>Click to Upload</oio-button>
  </oio-upload>
</template>
<script lang="ts">
import { FileModel, OioButton, OioUpload } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioButton,
    OioUpload
  },
  props: {},
  setup(props) {
    const fileList = ref<FileModel[]>([]);

    const onSuccess = (file: FileModel) => {
      fileList.value.push(file);
    };

    const onFailure = (file: FileModel) => {
      console.log(file);
    };

    return {
      fileList,
      onSuccess,
      onFailure
    };
  }
});
</script>

Upload Image

<template>
  <oio-upload
    :upload-list="fileList"
    list-type="picture-card"
    :multiple="false"
    :show-upload-list="false"
    @success="onSuccess"
    @failure="onFailure"
  >
    <img v-if="imageUrl" :src="imageUrl" alt="avatar" />
    <div v-else>
      <upload-outlined />
      <div>Click to Upload</div>
    </div>
  </oio-upload>
</template>
<script lang="ts">
import { UploadOutlined } from '@ant-design/icons-vue';
import { FileModel, OioUpload } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioUpload,
    UploadOutlined
  },
  props: {},
  setup(props) {
    const fileList = ref<FileModel[]>([]);
    const imageUrl = ref();

    const onSuccess = (file: FileModel) => {
      fileList.value = [file];
      imageUrl.value = file.url;
    };

    const onFailure = (file: FileModel) => {
      console.log(file);
    };

    return {
      fileList,
      imageUrl,
      onSuccess,
      onFailure
    };
  }
});
</script>

API

Props

Parameter NameTypeDefault ValueDescription
multiplebooleantrueWhether to support multi-file upload
limitnumber-1Maximum number of upload files (-1 means no limit)
limitSizenumber-1Single file size limit (unit: MB, -1 means no limit)
listTypestring'text'File list display type ('text'/'picture'/'picture-card')
showUploadListboolean{ showPreviewIcon?: boolean; showRemoveIcon?: boolean }undefined
disabledbooleanfalseWhether to disable the upload function
beforeUpload(file: FileItem, fileList: FileItem[]) => booleanPromise<boolean>-
progressRecord<string, unknown>-Upload progress style configuration
onReject(file: FileItem, fileList: FileItem[]) => void-Callback when file format or size validation fails
onDrop(file: FileItem, event: Event) => void-Callback when file is dragged and dropped
customRequest({ file, onSuccess, onError, onProgress }) => void-Custom upload request function (overrides default request logic)
removeCallback(file: FileItem) => Promise<boolean>-Callback when deleting a file (return false to prevent deletion)
readonlybooleanfalseWhether it is in read-only mode (hides upload button and delete icon)
partSizenumber-Size of each fragment for fragment upload (unit: MB)
chunkUploadThresholdnumber-File size threshold for enabling fragment upload (unit: MB, fragment upload is enabled when the file is larger than this value)
parallelnumber-Number of concurrent fragment uploads
acceptstringstring[]-
uploadListFileModel[][]Upload file list (supports two-way binding)
managedbooleanfalseWhether to enable file management mode (cooperates with the background to manage file status)
manualbooleanfalseWhether to trigger upload manually (turns off auto-upload, requires calling the handleUpload method)
cdnKeystring-Resource key for CDN upload (used to generate upload address)
contentTypestring''Content-Type type of the upload request

Events

Event NameParameter TypeDescription
success(file: FileModel) => voidTriggered when file upload is successful
failure(error: Error, file: FileModel) => voidTriggered when file upload fails

Slots

Slot NameParametersDescription
default-Custom upload trigger area
itemRender{ file: FileItem, onPreview, onRemove }Custom file list item
previewIcon{ file: FileItem, continuedUpload }Custom preview icon
removeIcon{ file: FileItem, continuedUpload }Custom delete icon

YearPicker Year Picker

Basic Usage

<template>
  <oio-year-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-date-picker
    class="oio-date-time-picker"
    dropdown-class-name="oio-date-time-picker-popper"
    picker="year"
    v-model:value="value"
  />
</template>

For more usage methods, please refer to: Antd DatePicker Date Picker For Vue

API

Props

Attribute NameTypeDefault ValueDescription
placeholderstringDefault copy related to the modeInput box placeholder text
readonlybooleanfalseWhether it is in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (such as YYYY)
valueFormatstringYYYYValue format
allowClearbooleantrueWhether to display the clear button
openbooleanundefinedControl the pop-up layer display (controlled mode)
changeOpenValuefunction-Callback when the pop-up layer display status changes
localeobject-Internationalization configuration (such as week, month names)
dropdownClassNamestringstring[]-
openPanelChangefunction-Callback when the pop-up layer opens
closePanelChangefunction-Callback when the pop-up layer closes
getTriggerContainerfunction() => document.bodyParent node where the pop-up layer is mounted
showTodaybooleantrueWhether to display the "Today" button
valueDatestring-
defaultValueDatestring-
disabledDate(date) => boolean-Disabled date judgment function
disabledTime(date) => { disabledHours: number[]; disabledMinutes: number[]; disabledSeconds: number[] }-Disabled time configuration (function or object)

YearRangePicker Year Range Picker

Basic Usage

<template>
  <oio-year-range-picker v-model:value="value" />
</template>

Only Apply Oinone Theme Style

<template>
  <a-range-picker
    class="oio-date-time-range-picker oio-date-time-picker-range-year"
    dropdown-class-name="oio-date-time-range-picker-popper oio-date-time-range-picker-popper-year"
    picker="year"
    v-model:value="value"
  />
</template>

For more usage methods, please refer to: Antd DatePicker Date Picker For Vue

API

Props

Attribute NameTypeDefault ValueDescription
placeholder[string, string]Default copy related to the modeInput box placeholder text (start and end)
readonlybooleanfalseWhether it is in read-only mode (non-clickable)
disabledbooleanfalseWhether to disable the picker
formatstring-Display format (such as YYYY)
valueFormatstringYYYYValue format (used for two-way binding)
allowClearbooleantrueWhether to display the clear button
dropdownClassNamestringstring[]-
separatorstring~Separator between start and end values
openPanelChangefunction-Callback when the pop-up layer opens
closePanelChangefunction-Callback when the pop-up layer closes
getTriggerContainerfunction() => document.bodyParent node where the pop-up layer is mounted
value[Datestringundefined, Date
defaultValue[Datestringundefined, Date

Events

Event NameParametersDescription
update:value[start: string, end: string]Triggered when the selected value changes (two-way binding)

(V) Data Display

Card Card

Basic Usage

<template>
  <oio-card title="Title">
    <p>This is a paragraph of content</p>
  </oio-card>
</template>

Card with Action Buttons

<template>
  <oio-card title="Title">
    <p>This is a paragraph of content</p>
    <template #titleToolbar>
      <oio-button>Title Bar Button</oio-button>
    </template>
    <template #toolbar>
      <oio-button type="link">Action Button 1</oio-button>
      <oio-button type="link">Action Button 2</oio-button>
      <oio-button type="link">Action Button 3</oio-button>
    </template>
  </oio-card>
</template>

API

Props

Parameter NameTypeDefault ValueDescription
titlestring-Card title text

Slots

Slot NameDescriptionParameters
defaultCard content area-
titleCustom title content-
titleToolbarRight toolbar of the title row-
toolbarBottom toolbar of the card (automatically adds a separator)-

Events

Event NameParametersDescription
clickMouseEventTriggered when the card is clicked

Collapse Collapsible Panel

Basic Usage

<template>
  <oio-collapse v-model:activeKey="activeKey">
    <oio-collapse-panel key="1" header="Panel 1">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
    <oio-collapse-panel key="2" header="Panel 2">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
    <oio-collapse-panel key="3" header="Panel 3" disabled>
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
  </oio-collapse>
</template>

Accordion Mode

<template>
  <oio-collapse v-model:activeKey="activeKey" accordion>
    <oio-collapse-panel key="1" header="Panel 1">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
    <oio-collapse-panel key="2" header="Panel 2">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
    <oio-collapse-panel key="3" header="Panel 3">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
  </oio-collapse>
</template>

Zebra Striped Style

<template>
  <oio-collapse v-model:activeKey="activeKey" type="stripe">
    <oio-collapse-panel key="1" header="Panel 1">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
    <oio-collapse-panel key="2" header="Panel 2">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
    <oio-collapse-panel key="3" header="Panel 3">
      <p>This is a paragraph of text</p>
    </oio-collapse-panel>
  </oio-collapse>
</template>

Only Apply Oinone Theme Style

<template>
  <!-- Basic Usage -->
  <a-collapse class="oio-collapse" v-model:activeKey="activeKey">
    <a-collapse-panel class="oio-collapse-panel" key="1" header="Panel 1">
      <p>This is a paragraph of text</p>
    </a-collapse-panel>
    <a-collapse-panel class="oio-collapse-panel" key="2" header="Panel 2">
      <p>This is a paragraph of text</p>
    </a-collapse-panel>
    <a-collapse-panel class="oio-collapse-panel" key="3" header="Panel 3">
      <p>This is a paragraph of text</p>
    </a-collapse-panel>
  </a-collapse>
  <!-- Zebra Striped Style -->
  <a-collapse class="oio-collapse oio-collapse-stripe" v-model:activeKey="activeKey">
    <a-collapse-panel class="oio-collapse-panel" key="1" header="Panel 1">
      <p>This is a paragraph of text</p>
    </a-collapse-panel>
    <a-collapse-panel class="oio-collapse-panel" key="2" header="Panel 2">
      <p>This is a paragraph of text</p>
    </a-collapse-panel>
    <a-collapse-panel class="oio-collapse-panel" key="3" header="Panel 3">
      <p>This is a paragraph of text</p>
    </a-collapse-panel>
  </a-collapse>
</template>

For more usage methods, please refer to: Antd Collapse Collapsible Panel For Vue

API

oio-collapse

Props

Parameter NameTypeDefault ValueDescription
activeKeystringstring[]-
typeOioCollapseType'bordered'Collapsible panel type, optional values: bordered, stripe, simple, ghost
collapseMethodOioCollapseMethod'default'Collapse trigger method, optional values: default (click header), header (click title), icon (click icon)
accordionbooleanfalseWhether to enable accordion mode (only one panel is active at a time)
expandIconPositionOioCollapseExpandIconPosition'right'Expand icon position, optional values: right (right), left (left), hidden (hidden)
destroyInactivePanelbooleanfalseWhether to destroy the DOM nodes of inactive panels
layoutFormLayout-Form layout
invisibleboolean-Whether to hide the component
disabledboolean-Whether to disable all panels
componentDataRecord<string, unknown>-Third-party extension attributes

Events

Event NameParameter TypeDescription
update:active-keystringstring[]

** Slots**

Slot NameDescription
defaultPanel content container

Methods

Method NameParametersDescription
getPanelKeys-Get the keys of all panels
oio-collapse-panel

Props

Parameter NameTypeDefault ValueDescription
keystring-Unique panel identifier (required)
forceRenderboolean-Whether to force render the panel (even if inactive)
collapseMethodOioCollapseMethodInherited from parent componentCollapse trigger method for a single panel (priority over parent component)
headerstringVNode'Collapsible Panel Item'
showArrowbooleanInherited from parent componentWhether to display the expand icon (invalid if parent component expandIconPosition is hidden)
layoutFormLayout-Form layout
invisibleboolean-Whether to hide the current panel
disabledboolean-Whether to disable the current panel
componentDataRecord<string, unknown>-Third-party extension attributes

Slots

Slot NameDescription
defaultPanel content
headerCustom title content
extraAdditional content on the right side of the title

Empty Empty State

Basic Usage

<template>
  <oio-empty-data />
</template>

Custom Description

<template>
  <oio-empty-data description="Empty Description" />
  <oio-empty-data>
    <template #description>
      <span>Empty Description</span>
    </template>
  </oio-empty-data>
</template>

API

Props

Parameter NameTypeDefault ValueDescription
loadingbooleanundefinedWhether to display the loading state (true displays loading animation, false displays empty state)
loadingIndicatorVNode-Custom loading icon
wrapperClassNamestringstring[]-
imagestring-URL or path of the empty state image
descriptionstring'No Data'
(obtained through $translate
)
Empty state description text (if not passed and there is no description
slot, the internationalized text is displayed by default)

Slots

Slot NameDescription
imageCustom empty state image content
descriptionCustom empty state description text

Gallery Gallery

Basic Usage

<template>
  <oio-gallery :list="list" item-key="key">
    <template #default="{ key, data, index }">
      <oio-card :title="data.name">
        <p>{{ data.description }}</p>
      </oio-card>
    </template>
  </oio-gallery>
</template>
<script lang="ts">
import { OioCard, OioGallery } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

interface DataItem {
  key: string;
  name: string;
  description: string;
}

export default defineComponent({
  components: {
    OioCard,
    OioGallery
  },
  props: {},
  setup(props) {
    const list = ref<DataItem[]>([]);

    for (let i = 1; i <= 6; i++) {
      list.value.push({
        key: `${i}`,
        name: `Item ${i}`,
        description: `This is a description${i}`
      });
    }

    return {
      list
    };
  }
});
</script>

Custom Number of Columns and Spacing

<template>
  <oio-gallery :list="list" item-key="key" :cols="3" gutter="24,24">
    <template #default="{ key, data, index }">
      <oio-card :title="data.name">
        <p>{{ data.description }}</p>
      </oio-card>
    </template>
  </oio-gallery>
</template>

API

Props

Parameter NameTypeDefault ValueDescription
loadingbooleanundefinedWhether to display the loading state (true
displays loading animation, false
hides)
loadingIndicatorVNode-Custom loading icon
wrapperClassNamestringstring[]-
listRecord<string, unknown>[]requiredData list (each object needs to contain a unique identifier field)
itemKeystring'id'Data item unique identifier field name
colsnumber4Number of columns (number of items displayed per row)
gutterCommonGutterType-Grid spacing (supports numeric, array, or object, such as 16
, [16, 24]
)
itemClassNamestringstring[]-
itemStyleCSSStyle-Data item container style

Slots

Slot NameParametersDescription
default{ key: string, data: Record<string, unknown>, index: number }Data item content
header-Header content
footer-Footer content

Group Group

Basic Usage

<template>
  <oio-group title="Title">
    <p>This is a paragraph of content</p>
  </oio-group>
</template>

Group with Description and Help Prompt

<template>
  <oio-group title="Title" description="This is the detailed description of the group" help="This is the help prompt content">
    <p>This is a paragraph of content</p>
  </oio-group>
</template>

Group with Toolbar

<template>
  <oio-group title="Title">
    <p>This is a paragraph of content</p>
    <template #titleToolbar>
      <oio-button>Action Button</oio-button>
    </template>
  </oio-group>
</template>

API

Props

Parameter NameTypeDefault ValueDescription
titlestringbooleanundefined
descriptionstring-Group description information
borderbooleantrueWhether to display a border
wrapperClassNamestringstring[]-
wrapperStylestringCSSStyle-
toolbarClassNamestringstring[]-
toolbarStylestringCSSStyle-
helpstring''Help prompt content
helpAdjustOverflowbooleantrueWhether the help prompt automatically adjusts the position to avoid overflow
helpBgColorstring-Background color of the help prompt
helpPlacementstring'top'Position of the help prompt, optional values: 'top', 'bottom', 'left', 'right', etc.
helpIconstring'oinone-wenhao'Class name of the help icon
helpIconColorstring'var(--oio-primary-color)'Color of the help icon
helpIconSizestring'var(--oio-font-size)'Size of the help icon

Slots

Slot NameDescription
defaultGroup content area
titleCustom title content
titleToolbarToolbar content on the right side of the title

Tabs Tabs

Basic Usage

<template>
  <oio-tabs v-model:active-key="activeKey">
    <oio-tab key="1" tab="Tab 1">Content 1</oio-tab>
    <oio-tab key="2" tab="Tab 2">Content 2</oio-tab>
    <oio-tab key="3" tab="Tab 3" force-render>Content 3</oio-tab>
    <oio-tab key="4" tab="Tab 4" disabled>Content 4</oio-tab>
  </oio-tabs>
</template>

Centered

<template>
  <oio-tabs v-model:active-key="activeKey" :component-data="{ centered: true }">
    <oio-tab key="1" tab="Tab 1">Content 1</oio-tab>
    <oio-tab key="2" tab="Tab 2">Content 2</oio-tab>
    <oio-tab key="3" tab="Tab 3">Content 3</oio-tab>
  </oio-tabs>
</template>

Tabs with Left and Right Action Buttons

<template>
  <oio-tabs v-model:active-key="activeKey">
    <oio-tab key="1" tab="Tab 1">Content 1</oio-tab>
    <oio-tab key="2" tab="Tab 2">Content 2</oio-tab>
    <oio-tab key="3" tab="Tab 3">Content 3</oio-tab>
    <template #tabBarLeftExtraContent>
      <oio-button style="margin-right: 16px">Left Action Button</oio-button>
    </template>
    <template #tabBarExtraContent>
      <oio-button>Right Action Button</oio-button>
    </template>
  </oio-tabs>
</template>

Left Tabs

<template>
  <oio-tabs v-model:active-key="activeKey" tab-position="left">
    <oio-tab key="1" tab="Tab 1">Content 1</oio-tab>
    <oio-tab key="2" tab="Tab 2">Content 2</oio-tab>
    <oio-tab key="3" tab="Tab 3">Content 3</oio-tab>
  </oio-tabs>
</template>

Card-style Tabs

<template>
  <oio-tabs v-model:active-key="activeKey" type="card">
    <oio-tab key="1" tab="Tab 1">Content 1</oio-tab>
    <oio-tab key="2" tab="Tab 2">Content 2</oio-tab>
    <oio-tab key="3" tab="Tab 3">Content 3</oio-tab>
  </oio-tabs>
</template>

Editable Tabs

<template>
  <oio-tabs v-model:active-key="activeKey" type="editable-card" @edit="onEdit">
    <oio-tab v-for="pane in panes" :key="pane.key" :tab="pane.title" :component-data="{ closable: pane.closable }">
      {{ pane.content }}
    </oio-tab>
  </oio-tabs>
</template>
<script lang="ts">
import { OioTab, OioTabs } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioTabs,
    OioTab
  },
  props: {},
  setup(props) {
    const activeKey = ref();

    const panes = ref<{ title: string; content: string; key: string; closable?: boolean }[]>([
      { title: 'Tab 1', content: 'Content 1', key: '1' },
      { title: 'Tab 2', content: 'Content 2', key: '2' },
      { title: 'Tab 3', content: 'Content 3', key: '3', closable: false }
    ]);

    const newTabIndex = ref(0);

    const add = () => {
      activeKey.value = `newTab${++newTabIndex.value}`;
      panes.value.push({ title: 'New Tab', content: 'New Tab Content', key: activeKey.value });
    };

    const remove = (targetKey: string) => {
      let lastIndex = 0;
      panes.value.forEach((pane, i) => {
        if (pane.key === targetKey) {
          lastIndex = i - 1;
        }
      });
      panes.value = panes.value.filter((pane) => pane.key !== targetKey);
      if (panes.value.length && activeKey.value === targetKey) {
        if (lastIndex >= 0) {
          activeKey.value = panes.value[lastIndex].key;
        } else {
          activeKey.value = panes.value[0].key;
        }
      }
    };

    const onEdit = (targetKey: string | MouseEvent, action: string) => {
      if (action === 'add') {
        add();
      } else {
        remove(targetKey as string);
      }
    };

    return {
      activeKey,
      panes,
      onEdit
    };
  }
});
</script>

API

oio-tabs

Props

Parameter NameTypeDefault ValueDescription
activeKeystringnumber-
tabPositionOioTabPosition'top'Tab position, optional values: top (top), bottom (bottom), left (left), right (right)
verticalHeightnumberstring-
destroyInactiveTabPanebooleanfalseWhether to destroy the DOM nodes of inactive panes
typeOioTabsType-Tab type, optional values: line (default), card (card-style tabs), editable-card (editable tabs)
layoutFormLayout-Form layout configuration
invisibleboolean-Whether to hide the entire tab container
disabledbooleanfalseWhether to disable all tabs (cannot be clicked to switch when disabled)
componentDataRecord<string, unknown>-Third-party extension attributes (passed through to the underlying component)

Events

Event NameParameter TypeDescription
update:active-keystringnumber

Slots

Slot NameDescription
defaultTab panel content (contains OioTab child components)
tabBarLeftExtraContentAdditional content on the left side of the tab bar (such as action buttons)
tabBarExtraContentAdditional content on the right side of the tab bar (such as action buttons)
oio-tab

Props

Parameter NameTypeDefault ValueDescription
keystringrequiredUnique panel identifier (required, needs to correspond to the panel key of the parent component OioTabs
)
tabstringVNode-
forceRenderboolean-Whether to force render the panel (even if inactive)
layoutFormLayout-Form layout configuration
invisibleboolean-Whether to hide the panel (cooperates with the hide logic of the parent component OioTabs)
disabledboolean-Whether to disable the panel (disabled tabs cannot be clicked, and content cannot be interacted with)
componentDataRecord<string, unknown>-Third-party extension attributes (passed through to the underlying component)

Slots

Slot NameDescription
defaultPanel content
tabCustom tab content

Tooltip Tooltip

Basic Usage

<template>
  <oio-tooltip title="This is the tooltip content">hover trigger</oio-tooltip>
</template>

Click Trigger

<template>
  <oio-tooltip title="This is the tooltip content" trigger="click">click trigger</oio-tooltip>
</template>

Tooltip on the Right

<template>
  <oio-tooltip title="This is the tooltip content" placement="rm">hover trigger</oio-tooltip>
</template>

API

Props

Parameter NameTypeDefault ValueDescription
visiblebooleanundefinedWhether to display the tooltip (two-way binding, invalid when disabled is true)
titlestring-Tooltip content (supports strings, or custom through the title
slot)
triggerPopperTrigger'hover'Trigger method, optional values: hover (hover), click (click), focus (focus), manual (manual), contextmenu (right-click)
placementOioTooltipPlacement'bm' (bottom middle)Tooltip position, optional values see enum OioTooltipPlacement
destroyOnHidebooleantrueWhether to destroy the tooltip DOM node when hidden
disabledbooleanfalseWhether to disable the tooltip (cannot be triggered to display when disabled)
overlayClassNamestring-Class name of the tooltip overlay
overlayStylestringCSSStyle-
getTriggerContainer(triggerNode: HTMLElement) => HTMLElement-Tooltip container mounting point (default mounted to body
, can specify a parent container)

Events

Event NameParameter TypeDescription
update:visiblebooleanTriggered when the display status changes (two-way binding)

Slots

Slot NameDescription
defaultContent that triggers the tooltip (such as a button)
titleCustom tooltip content (supports HTML)

Tree Tree Control

Basic Usage

<template>
  <oio-tree :data="treeData" />
</template>
<script lang="ts">
import { OioTree, OioTreeNode, TreeNodeSelectedEvent } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

interface DataItem {
  key: string;
  title: string;
  children?: DataItem[];
}

const convert = (data: DataItem[]): OioTreeNode<DataItem>[] => {
  return data.map((item) => {
    return {
      key: item.key,
      value: item,
      title: item.title,
      isLeaf: !item.children?.length,
      children: (item.children && convert(item.children)) || []
    } as OioTreeNode<DataItem>;
  });
};

export default defineComponent({
  components: {
    OioTree
  },
  props: {},
  setup(props) {
    const treeData = ref<OioTreeNode<DataItem>[]>(
      convert([
        {
          key: '1',
          title: 'a',
          children: [
            {
              key: '1-1',
              title: 'a-1'
            },
            {
              key: '1-2',
              title: 'a-2'
            }
          ]
        },
        {
          key: '2',
          title: 'b'
        }
      ])
    );

    return {
      treeData
    };
  }
});
</script>

Only Apply Oinone Theme Style

<template>
  <a-tree class="oio-tree" :tree-data="treeData" />
</template>

For more usage methods, please refer to: Antd Tree Tree Control For Vue

API

Props

Parameter NameTypeDefault ValueDescription
loadingbooleanundefinedWhether to display the loading state (true displays loading animation)
wrapperClassNamestringstring[]-
dataOioTreeNode[]-Tree structure data
loadData(node: OioTreeNode) => Promise<void>-Lazy loading data function (dynamic data, choose one with data
)
loadedKeysstring[]-Keys of loaded nodes (maintained internally, supports two-way binding)
selectablebooleanundefinedWhether to allow node selection
selectedKeysstring[]-Keys of selected nodes (supports two-way binding)
expandedKeysstring[]-Keys of expanded nodes (supports two-way binding)
checkablebooleanundefinedWhether to enable the check function
checkedKeysstring[]{ checked: string[]; halfChecked: string[]}-
checkStrictlybooleanundefinedWhether to strictly follow the parent-child node association (whether to automatically uncheck child nodes when unchecking a parent node)
blockNodebooleanundefinedWhether to display as a block-level node (occupies the entire line)
showIconbooleanundefinedWhether to display node icons
showLinebooleanundefinedWhether to display node connection lines

Events

Event NameParameter TypeDescription
update:expandedKeysstring[]Triggered when expanded nodes change (two-way binding)
update:selectedKeysstring[]Triggered when selected nodes change (two-way binding)
update:checkedKeysstring[]{ checked: string[]; halfChecked: string[]}
update:loadedKeysstring[]Triggered when loaded nodes change (internal use)
selectedTreeNodeSelectedEventTriggered when a node is selected / deselected
expandedTreeNodeExpandedEventTriggered when a node is expanded / collapsed
checkedTreeNodeCheckedEventTriggered when a node's check status changes

Slots

Slot NameParametersDescription
title{ node: OioTreeNode }Custom node title
icon{ node: OioTreeNode }Custom node icon
switcherIcon{ node: OioTreeNode }Custom expand / collapse icon

(VI) Feedback

Drawer Drawer

Basic Usage

<template>
  <oio-button @click="showDrawer">Open Drawer</oio-button>
  <oio-drawer v-model:visible="visible" title="Basic Usage">
    <p>This is some content...</p>
    <p>This is some content...</p>
    <p>This is some content...</p>
  </oio-drawer>
</template>
<script lang="ts">
import { OioButton, OioDrawer } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioButton,
    OioDrawer
  },
  props: {},
  setup(props) {
    const visible = ref(false);

    const showDrawer = () => {
      visible.value = true;
    };

    return {
      visible,
      showDrawer
    };
  }
});
</script>

Add Help Copy

<template>
  <oio-button @click="showDrawer">Open Drawer</oio-button>
  <oio-drawer v-model:visible="visible" title="Basic Usage" help="This is the simplest drawer">
    <p>This is some content...</p>
    <p>This is some content...</p>
    <p>This is some content...</p>
  </oio-drawer>
</template>

Add Some Action Buttons

<template>
  <oio-button @click="showDrawer">Open Drawer</oio-button>
  <oio-drawer v-model:visible="visible" title="Basic Usage">
    <p>This is some content...</p>
    <p>This is some content...</p>
    <p>This is some content...</p>
    <template #footer>
      <oio-button type="primary">Confirm</oio-button>
      <oio-button>Cancel</oio-button>
    </template>
  </oio-drawer>
</template>

Drawer Close Callback

<template>
  <oio-button @click="showDrawer">Open Drawer</oio-button>
  <oio-drawer v-model:visible="visible" title="Close Callback" :cancel-callback="cancelCallback">
    <p>This is some content...</p>
    <p>This is some content...</p>
    <p>This is some content...</p>
  </oio-drawer>
</template>
<script lang="ts">
import { OioButton, OioDrawer } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioButton,
    OioDrawer
  },
  props: {},
  setup(props) {
    const visible = ref(false);

    const showDrawer = () => {
      visible.value = true;
    };

    const cancelCallback = (): boolean => {
      console.log('drawer closed.');
      // Return true to close the drawer, otherwise do not close
      return true;
    };

    return {
      visible,
      showDrawer,
      cancelCallback
    };
  }
});
</script>

API

Props

Parameter NameTypeDefault ValueDescription
zIndexnumber1000Drawer stacking order (CSS z-index)
wrapperClassNamestringstring[]-
wrapperPropsobject-Outer container attributes (passed through to DOM nodes)
maskbooleanundefinedWhether to display the mask layer
maskClosablebooleanundefinedWhether clicking the mask can close the drawer
titlestring'Drawer'Drawer title
helpstring-Help prompt content on the right side of the title
placementDrawerPlacement
keyof typeof DrawerPlacement'right'
widthnumberstringDrawerWidth
heightnumberstringDrawerHeight
headerInvisiblebooleanundefinedWhether to hide the header area
footerInvisiblebooleanundefinedWhether to hide the footer area
visiblebooleanundefinedWhether to display the drawer (two-way binding)
closablebooleanundefinedWhether to display the close icon
keyboardbooleanundefinedWhether to support closing with the ESC key
destroyOnClosebooleantrueWhether to destroy internal elements when closing
getTriggerContainer(triggerNode: NodeHTMLElement) => NodeHTMLElement
cancelCallback(event: PointerEvent, data: object) => Promise<booleanvoid>-
loadingbooleanfalseWhether to display the global loading state

Events

Event NameParameter TypeDescription
update:visiblebooleanTriggered when the visibility status changes (two-way binding)

Slots

Slot NameParametersDescription
default{ data: object }Drawer content area
title-Custom title content
header-Custom header area (higher priority than the title slot)
footer-Custom footer area
closeIcon-Custom close icon

Message Global Prompt

Basic Usage

<template>
  <oio-button @click="openMessage">Open Message Prompt</oio-button>
</template>
<script lang="ts">
import { OioButton, OioMessage } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent } from 'vue';

export default defineComponent({
  components: {
    OioButton
  },
  props: {},
  setup(props) {
    const openMessage = () => {
      OioMessage.info('This is the message prompt content', {
        onClose: () => {
          console.log('Message closed.');
        }
      });
    };

    return {
      openMessage
    };
  }
});
</script>

For more usage methods, please refer to: Antd Message Global Prompt For Vue

API

OioMessage
Method NameParameter ListDescription
open(type: NotificationType, message: string, options?: OioNotificationOptions) => voidGeneral opening method, displays corresponding messages according to types
info(message: string, options?: OioNotificationOptions) => voidDisplays prompt-type messages
success(message: string, options?: OioNotificationOptions) => voidDisplays success-type messages
warning(message: string, options?: OioNotificationOptions) => voidDisplays warning-type messages
error(message: string, options?: OioNotificationOptions) => voidDisplays error-type messages
OioNotificationOptions
Parameter NameTypeDefault ValueDescription
durationnumber3Notification display duration (seconds), 0
for permanent display
classstring-Custom notification class name (base class name will be added automatically)
.........Other third-party parameters

Modal Dialog Box

Basic Usage

<template>
  <oio-button @click="showModal">Open Popup</oio-button>
  <oio-modal v-model:visible="visible" title="Basic Usage">
    <p>This is some content...</p>
    <p>This is some content...</p>
    <p>This is some content...</p>
  </oio-modal>
</template>
<script lang="ts">
import { OioButton, OioModal } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioButton,
    OioModal
  },
  props: {},
  setup(props) {
    const visible = ref(false);

    const showModal = () => {
      visible.value = true;
    };

    return {
      visible,
      showModal
    };
  }
});
</script>

Adding Help Copy

<template>
  <oio-button @click="showModal">Open Popup</oio-button>
  <oio-modal v-model:visible="visible" title="Basic Usage" help="This is the simplest popup">
    <p>This is some content...</p>
    <p>This is some content...</p>
    <p>This is some content...</p>
  </oio-modal>
</template>

Popup Close Callback

<template>
  <oio-button @click="showModal">Open Popup</oio-button>
  <oio-modal
    v-model:visible="visible"
    title="Close Callback"
    :enter-callback="enterCallback"
    :cancel-callback="cancelCallback"
  >
    <p>This is some content...</p>
    <p>This is some content...</p>
    <p>This is some content...</p>
  </oio-modal>
</template>
<script lang="ts">
import { OioButton, OioModal } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

export default defineComponent({
  components: {
    OioButton,
    OioModal
  },
  props: {},
  setup(props) {
    const visible = ref(false);

    const showModal = () => {
      visible.value = true;
    };

    const enterCallback = (): boolean => {
      console.log('modal closed by enter button.');
      // Return true to close the popup, otherwise do not close
      return true;
    };

    const cancelCallback = (): boolean => {
      console.log('modal closed by cancel button.');
      // Return true to close the popup, otherwise do not close
      return true;
    };

    return {
      visible,
      showModal,
      enterCallback,
      cancelCallback
    };
  }
});
</script>

Rendering Forms and Data回填 (Data回填 should be "Data Backfill")

<template>
  <oio-button @click="showModal">Open Popup</oio-button>
  <oio-modal
    v-model:visible="visible"
    title="Render Form"
    :data="formData"
    :enter-callback="enterCallback"
    :cancel-callback="cancelCallback"
  >
    <template #default="{ data }">
      <oio-form :data="data" layout="vertical">
        <oio-form-item label="Name">
          <oio-input v-model:value="data.name" />
        </oio-form-item>
        <oio-form-item label="Description">
          <oio-textarea v-model:value="data.description" />
        </oio-form-item>
      </oio-form>
    </template>
  </oio-modal>
</template>
<script lang="ts">
import { OioButton, OioForm, OioFormItem, OioInput, OioModal, OioTextarea } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent, ref } from 'vue';

interface DataType {
  name: string;
  description: string;
}

export default defineComponent({
  components: {
    OioButton,
    OioForm,
    OioFormItem,
    OioInput,
    OioModal,
    OioTextarea
  },
  props: {},
  setup(props) {
    const visible = ref(false);

    const showModal = () => {
      visible.value = true;
    };

    const formData = ref<DataType>({
      name: 'Name',
      description: ''
    });

    const enterCallback = (e: PointerEvent, data: DataType): boolean => {
      // Save the current form data
      formData.value = data;
      console.log('modal closed by enter button.', data);
      // Return true to close the popup, otherwise do not close
      return true;
    };

    const cancelCallback = (e: PointerEvent, data: DataType): boolean => {
      console.log('modal closed by cancel button.', data);
      // Return true to close the popup, otherwise do not close
      return true;
    };

    return {
      visible,
      showModal,
      formData,
      enterCallback,
      cancelCallback
    };
  }
});
</script>

API Definition

Props

Parameter NameTypeDefault ValueDescription
zIndexnumber1000Modal dialog stacking order (CSS z-index)
wrapperClassNamestringstring[]-
wrapperPropsobject-Outer container properties (passed through to DOM nodes)
maskbooleanundefinedWhether to display the mask layer
maskClosablebooleanundefinedWhether clicking the mask can close the modal dialog
titlestring'Dialog Box'Modal dialog title
helpstring-Help prompt content on the right side of the title
widthnumberstringModalWidthType
heightnumberstringModalWidthType
headerInvisiblebooleanundefinedWhether to hide the header area
footerInvisiblebooleanundefinedWhether to hide the footer area
visiblebooleanundefinedWhether to display the modal dialog (two-way binding)
closablebooleanundefinedWhether to display the close icon
keyboardbooleanundefinedWhether to support closing with the ESC key
destroyOnClosebooleanundefinedWhether to destroy internal elements when closing
getTriggerContainer(triggerNode: NodeHTMLElement) => NodeHTMLElement
enterCallback(event: PointerEvent, data: object) => Promise<booleanvoid>-
cancelCallback(event: PointerEvent, data: object) => Promise<booleanvoid>-
loadingbooleanundefinedWhether to display the global loading state
confirmLoadingbooleanundefinedConfirm button loading state
draggablebooleanfalseWhether to support dragging the modal dialog
enterTextstring'Confirm'Confirm button text
cancelTextstring'Cancel'Cancel button text
dataobject{}Custom data passed to the slot
copybooleantrueWhether to deeply copy data (takes effect when deep is true)
deepbooleanfalseWhether to deeply listen for data changes

Events

Event NameParameter TypeDescription
update:visiblebooleanTriggered when the visibility status changes (two-way binding)

Slots

Slot NameParametersDescription
default{ data: object }Modal dialog content area
title-Custom title content
header-Custom header area (higher priority than the title slot)
footer-Custom footer area
closeIcon-Custom close icon

Notification Reminder Box

Basic Usage

<template>
  <oio-button @click="openNotification">Open Notification</oio-button>
</template>
<script lang="ts">
import { OioButton, OioNotification } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent } from 'vue';

export default defineComponent({
  components: {
    OioButton
  },
  props: {},
  setup(props) {
    const openNotification = () => {
      OioNotification.info('Title', 'This is the notification message content', {
        onClick: () => {
          console.log('Notification clicked.');
        },
        onClose: () => {
          console.log('Notification closed.');
        }
      });
    };

    return {
      openNotification
    };
  }
});
</script>

For more usage methods, please refer to: Antd Notification Reminder Box For Vue

API

OioNotification
Method NameParameter ListDescription
open(type: NotificationType, title: string, message?: string, options?: OioNotificationOptions) => voidGeneral opening method, displays notifications with titles
info(title: string, message?: string, options?: OioNotificationOptions) => voidDisplays prompt-type notifications
success(title: string, message?: string, options?: OioNotificationOptions) => voidDisplays success-type notifications
warning(title: string, message?: string, options?: OioNotificationOptions) => voidDisplays warning-type notifications
error(title: string, message?: string, options?: OioNotificationOptions) => voidDisplays error-type notifications
OioNotificationOptions
Parameter NameTypeDefault ValueDescription
durationnumber3Notification display duration (seconds), 0
for permanent display
classstring-Custom notification class name (base class name will be added automatically)
.........Other third-party parameters

Popconfirm Bubble Confirmation Box

Basic Usage

<template>
  <oio-popconfirm text="Are you sure you want to delete this?" :confirm-callback="confirmCallback" :cancel-callback="cancelCallback">
    <oio-button type="primary" biz-style="danger">Delete</oio-button>
  </oio-popconfirm>
</template>
<script lang="ts">
import { OioButton, OioPopconfirm } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent } from 'vue';

export default defineComponent({
  components: {
    OioButton,
    OioPopconfirm
  },
  props: {},
  setup(props) {
    const confirmCallback = (): void => {
      console.log('confirm callback.');
    };

    const cancelCallback = (): void => {
      console.log('cancel callback.');
    };

    return {
      confirmCallback,
      cancelCallback
    };
  }
});
</script>

Conditional Triggering

<template>
  <oio-popconfirm
    text="Are you sure you want to delete this?"
    :condition="condition"
    :confirm-callback="confirmCallback"
    :cancel-callback="cancelCallback"
  >
    <oio-button type="primary" biz-style="danger">Delete</oio-button>
  </oio-popconfirm>
</template>
<script lang="ts">
import { OioButton, OioPopconfirm } from '@oinone/kunlun-vue-ui-antd';
import { defineComponent } from 'vue';

export default defineComponent({
  components: {
    OioButton,
    OioPopconfirm
  },
  props: {},
  setup(props) {
    let num = 1;
    const condition = (): boolean => {
      const res = num++ % 2 === 0;
      if (res) {
        console.log('confirm execution.');
      } else {
        console.log('execution.');
      }
      return res;
    };

    const confirmCallback = (): void => {
      console.log('confirm callback.');
    };

    const cancelCallback = (): void => {
      console.log('cancel callback.');
    };

    return {
      condition,
      confirmCallback,
      cancelCallback
    };
  }
});
</script>

API

Props

Parameter NameTypeDefault ValueDescription
visiblebooleanundefinedWhether to display the popup (two-way binding, needs manual control when manual is true)
manualbooleanfalseWhether to enable manual control mode (true means visible changes will not automatically show/hide)
destroyOnClosebooleanundefinedWhether to destroy the popup DOM node when closing
titlestring'Warning'Popup title
textstring'Are you sure you want to perform this operation?'Popup prompt text
overlayClassNamestring-Class name of the popup overlay
placementPopconfirmPlacement'tm'Popup position (enumeration values see above description, default top middle)
enterTextstring'Confirm'Confirm button text
cancelTextstring'Cancel'Cancel button text
conditionboolean() => booleanPromise<boolean>
confirmCallback() => void-Confirm button click callback
cancelCallback() => void-Cancel button click callback
getTriggerContainer(triggerNode: NodeHTMLElement) => NodeHTMLElement

Events

Event NameParameter TypeDescription
update:visiblebooleanTriggered when the visibility status changes (two-way binding)

Slots

Slot NameDescription
defaultContent that triggers the popup (such as a button)
titleCustom title content
iconCustom icon on the left side of the title

Spin Loading

Basic Usage

<template>
  <oio-spin />
</template>

Masking Any Element

<template>
  <oio-spin>
    <div style="width: 300px; height: 300px">
      <h4>Title</h4>
      <p>This is a paragraph of content</p>
    </div>
  </oio-spin>
</template>

Various Sizes

<template>
  <oio-spin size="small" />
  <oio-spin />
  <oio-spin size="large" />
</template>

Placing in a Container

<template>
  <div style="padding: 30px 50px; background-color: rgba(0, 0, 0, 0.05); text-align: center">
    <oio-spin />
  </div>
</template>

Manually Controlling the Loading State

<template>
  <div>
    <span>Loading status:</span>
    <oio-switch v-model:checked="loading" />
  </div>
  <oio-spin :loading="loading">
    <div style="width: 300px; height: 300px">
      <h4>Title</h4>
      <p>This is a paragraph of content</p>
    </div>
  </oio-spin>
</template>

API

Props

Parameter NameTypeDefault ValueDescription
loadingbooleanundefinedWhether to display the loading state (undefined
means display by default)
loadingIndicatorVNode-Custom loading icon (needs to pass a virtual node, such as <LoadingOutlined />
)
wrapperClassNamestringstring[]-
sizeSpinSize
keyof typeof SpinSizenumber
delaynumber-Delay display time (milliseconds, displays the loading icon after loading
is true
for the specified time)
tipstringSlot-

Slots

Slot NameDescriptionParameters
defaultCustom loading content-
tipCustom prompt text content-
Edit this page
Last Updated:1/15/26, 4:02 AM
Prev
Gallery Field
Next
Vue UI El
默认页脚
Copyright © 2026 Mr.Hope