-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<FPopper placement="bottom" trigger="hover" :arrow="true"> | ||
<template #trigger> | ||
<FButton>Hover to activate</FButton> | ||
</template> | ||
<div style="padding: 30px"> | ||
this is content, this is content, this is content | ||
</div> | ||
</FPopper> | ||
<FPopper placement="top" trigger="click" :arrow="true"> | ||
<template #trigger> | ||
<FButton style="margin-left: 10px">Click to activate</FButton> | ||
</template> | ||
<div style="padding: 30px"> | ||
this is content, this is content, this is content | ||
</div> | ||
</FPopper> | ||
<FPopper placement="right" trigger="focus" :arrow="true"> | ||
<template #trigger> | ||
<FButton style="margin-left: 10px">Focus to activate</FButton> | ||
</template> | ||
<div style="padding: 30px"> | ||
this is content, this is content, this is content | ||
</div> | ||
</FPopper> | ||
</template> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Popper 弹出信息 | ||
|
||
在内容周围弹出一些隐藏的信息。内置样式,需要自行定制。 | ||
如果你只想展示一些基本的文本内容,推荐使用 `Tooltip`。 | ||
|
||
## 组件注册 | ||
|
||
```js | ||
import { FPopper } from '@fesjs/fes-design'; | ||
|
||
app.use(FPopper); | ||
``` | ||
|
||
## 代码演示 | ||
|
||
### 基础用法 | ||
|
||
属性 `trigger` 设置触发方式,`hover`、`click`、`focus`。 | ||
|
||
:::demo | ||
common.vue | ||
::: | ||
|
||
### 是否显示 | ||
|
||
:::demo | ||
visible.vue | ||
::: | ||
|
||
## Popper Props | ||
|
||
| 属性 | 说明 | 类型 | 默认值 | | ||
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | --------------------- | | ||
| v-model | 手动控制显示 | boolean | `false` | | ||
| placement | 出现的位置,可选值有`top` `top-start` `top-end` `bottom` `bottom-start` `bottom-end` `right` `right-start` `right-end` `left` `left-start` `left-end` | string | `auto` | | ||
| trigger | 触发类型`hover` `click` `focus`, confirm 模式下只能是`click` | string | `hover` | | ||
| disabled | 是否可用 | boolean | `false` | | ||
| offset | 出现位置的偏移量 | number | `6` | | ||
| arrow | 是否显示箭头 | boolean | `true` | | ||
| appendToContainer | 弹窗内容是否添加到指定的 DOM 元素 | boolean | `true` | | ||
| popperClass | 弹出框的样式类名 | string \| object \| Array | - | | ||
| popperStyle | 弹出框的样式 | object | - | | ||
| showAfter | 显示的延迟时间 | number | `0` | | ||
| hideAfter | 隐藏的延迟时间 | number | `0` | | ||
| lazy | 是否懒渲染 | boolean | `true` | | ||
| getContainer | 配置渲染节点的输出位置 | () => HTMLElement | `() => document.body` | | ||
|
||
## Popper Slots | ||
|
||
| 名称 | 说明 | | ||
| ------- | ------------------ | | ||
| trigger | 触发提示包裹的内容 | | ||
| default | 提示内容 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<FSpace> | ||
<FForm :labelWidth="100"> | ||
<FFormItem label="是否显示:"> | ||
<FRadioGroup | ||
v-model="visible" | ||
:cancelable="false" | ||
:options="[ | ||
{ label: '否(默认)', value: false }, | ||
{ label: '是', value: true }, | ||
]" | ||
@change=" | ||
(value) => { | ||
console.log(value); | ||
} | ||
" | ||
/> | ||
</FFormItem> | ||
</FForm> | ||
</FSpace> | ||
|
||
<FDivider></FDivider> | ||
|
||
<FPopper v-model="visible" placement="bottom" trigger="click" :arrow="true"> | ||
<template #trigger> | ||
<FButton>Click to activate</FButton> | ||
</template> | ||
<div style="padding: 30px"> | ||
this is content, this is content, this is content | ||
</div> | ||
</FPopper> | ||
</template> | ||
|
||
<script setup> | ||
import { ref } from 'vue'; | ||
const visible = ref(false); | ||
</script> | ||
|
||
<style scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Tooltip 文字提示 | ||
|
||
文字提示主要用于某个元素的辅助提示 | ||
文字提示主要用于某个元素的辅助提示。 | ||
基于 `Popper` 组件做的封装。 | ||
|
||
## 组件注册 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters