@101media/vue3-ui 中文文档教程

发布于 3年前 浏览 28 项目主页 更新于 3年前

Vue3-UI

npm(标签) 许可证 上次提交

Vue3-UI 是一个为 Bootstrap 5 实现了一些默认 UI 元素的包。

Installation

使用 npm:

$ npm install @101media/vue3-ui

使用 bower:

$ bower install @101media/vue3-ui

使用 yarn:

$ yarn add @101media/vue3-ui

Usage

import {createApp} from 'vue';
import Ui from "@101media/vue3-ui";


const app = createApp({
    //
});

app.use(Ui)
...

Configuration

可以在初始化插件时设置默认配置。

```js 从'vue'导入{createApp}; 从“@101media/vue3-ui”导入用户界面;

常量 UiConfig = { 对话:{ cancelClass: 'btn-危险', confirmClass: 'btn-成功', 中心:真实, } }

const app = createApp({ // });

app.use(Ui, UiConfig)

## Components

All components support default HTML attributes.

### Button

Show a button.

`String type`
The button type

`String class`
The button class

`Boolean block`
Whether the button should be displayed as block.

`String text`
The button text

### Checkbox

Show a checkbox.

`String type`
Define the input type.

`Boolean switches`
Whether the checkbox should be a switch

`Array|Boolean checked`
whether the checkbox is checked

`Any value`
The checkbox value

`String formClass`
The class of the form group

### Input

Show an input.

`String id`
The component ID

`String error`
The error message

`Boolean group`
Whether the input should be grouped

`String groupClass`
The class for the form group

`String type`
The input type

js


html

### Dialog

Dialog spawns a modal to confirm an action.

Ask user to confirm an action. Promise will only be resolved when user confirms action.

So `action.execute()` will only be executed once the user confrims the dialog.

#### confirm

js 这个.$ui.dialog.confirm({ message: '继续这个任务吗?', }).then(() => action.execute())

#### Alert

js 这个.$ui.dialog.alert({ message: '继续这个任务吗?', }).then(() => action.execute()) ```

Properties

字符串消息 对话框中显示的消息

String title 对话框模式中显示的标题

String confirmClass 确认按钮类

String confirmText 确认按钮的文本

String cancelClass 取消按钮类

String cancelText 取消按钮的文字

String canCancel 是否显示取消按钮 默认处于警报状态是 false

String headerClass 标头类

String headerTitleClass 标题标题类

Credits

Vue3-UI 的灵感来自 Buefy

License

在麻省理工学院许可下发布的代码。

Vue3-UI

npm (tag) License Last commit

Vue3-UI is a package that implements some default UI elements for Bootstrap 5.

Installation

Using npm:

$ npm install @101media/vue3-ui

Using bower:

$ bower install @101media/vue3-ui

Using yarn:

$ yarn add @101media/vue3-ui

Usage

import {createApp} from 'vue';
import Ui from "@101media/vue3-ui";


const app = createApp({
    //
});

app.use(Ui)
...

Configuration

Default configuration can be set when initializing plugin.

```js import {createApp} from 'vue'; import Ui from "@101media/vue3-ui";

const UiConfig = { dialog: { cancelClass: 'btn-danger', confirmClass: 'btn-success', center: true, } }

const app = createApp({ // });

app.use(Ui, UiConfig)

## Components

All components support default HTML attributes.

### Button

Show a button.

`String type`
The button type

`String class`
The button class

`Boolean block`
Whether the button should be displayed as block.

`String text`
The button text

### Checkbox

Show a checkbox.

`String type`
Define the input type.

`Boolean switches`
Whether the checkbox should be a switch

`Array|Boolean checked`
whether the checkbox is checked

`Any value`
The checkbox value

`String formClass`
The class of the form group

### Input

Show an input.

`String id`
The component ID

`String error`
The error message

`Boolean group`
Whether the input should be grouped

`String groupClass`
The class for the form group

`String type`
The input type

js


html

### Dialog

Dialog spawns a modal to confirm an action.

Ask user to confirm an action. Promise will only be resolved when user confirms action.

So `action.execute()` will only be executed once the user confrims the dialog.

#### confirm

js this.$ui.dialog.confirm({ message: 'Continue on this task?', }).then(() => action.execute())

#### Alert

js this.$ui.dialog.alert({ message: 'Continue on this task?', }).then(() => action.execute()) ```

Properties

String message The message that is shown in the dialog

String title The title shown in the dialog modal

String confirmClass The class of the confirm button

String confirmText The text of the confirm button

String cancelClass The class of the cancel button

String cancelText The text of the cancel button

String canCancel Whether the cancel button if shown or not default is on alert is false

String headerClass The header class

String headerTitleClass The header title class

Credits

Vue3-UI is inspired by Buefy.

License

Code released under MIT license.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文