|
@@ -1,21 +1,8 @@
|
|
-<style>
|
|
|
|
- .demo-box.demo-popover {
|
|
|
|
- .el-popover + .el-popover {
|
|
|
|
- margin-left: 10px;
|
|
|
|
- }
|
|
|
|
- .el-input {
|
|
|
|
- width: 360px;
|
|
|
|
- }
|
|
|
|
- .el-button {
|
|
|
|
- margin-left: 10px;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</style>
|
|
|
|
-
|
|
|
|
<script>
|
|
<script>
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
|
|
+ visible: false,
|
|
visible2: false,
|
|
visible2: false,
|
|
gridData: [{
|
|
gridData: [{
|
|
date: '2016-05-02',
|
|
date: '2016-05-02',
|
|
@@ -94,6 +81,20 @@
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
+<style>
|
|
|
|
+ .demo-box.demo-popover {
|
|
|
|
+ .el-popover + .el-popover {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+ .el-input {
|
|
|
|
+ width: 360px;
|
|
|
|
+ }
|
|
|
|
+ .el-button {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|
|
|
|
+
|
|
## Popover
|
|
## Popover
|
|
|
|
|
|
### Uso básico
|
|
### Uso básico
|
|
@@ -103,33 +104,55 @@ Similar a un Tooltip, Popover está construido con `Vue-popper`. Así que para a
|
|
:::demo El atributo `trigger` es usado para definir como el popover se dispara: `hover`, `click`, `focus` o `manual`. As for the triggering element, you can write it in two different ways: use the `slot="reference"` [named slot](https://vuejs.org/v2/guide/components.html#Named-Slots), or use the `v-popover` directive and set it to Popover's `ref`.
|
|
:::demo El atributo `trigger` es usado para definir como el popover se dispara: `hover`, `click`, `focus` o `manual`. As for the triggering element, you can write it in two different ways: use the `slot="reference"` [named slot](https://vuejs.org/v2/guide/components.html#Named-Slots), or use the `v-popover` directive and set it to Popover's `ref`.
|
|
|
|
|
|
```html
|
|
```html
|
|
-<el-popover
|
|
|
|
- placement="top-start"
|
|
|
|
- title="Title"
|
|
|
|
- width="200"
|
|
|
|
- trigger="hover"
|
|
|
|
- content="this is content, this is content, this is content">
|
|
|
|
- <el-button slot="reference">Hover to activate</el-button>
|
|
|
|
-</el-popover>
|
|
|
|
|
|
+<template>
|
|
|
|
+ <el-popover
|
|
|
|
+ placement="top-start"
|
|
|
|
+ title="Title"
|
|
|
|
+ width="200"
|
|
|
|
+ trigger="hover"
|
|
|
|
+ content="this is content, this is content, this is content">
|
|
|
|
+ <el-button slot="reference">Hover to activate</el-button>
|
|
|
|
+ </el-popover>
|
|
|
|
|
|
-<el-popover
|
|
|
|
- placement="bottom"
|
|
|
|
- title="Title"
|
|
|
|
- width="200"
|
|
|
|
- trigger="click"
|
|
|
|
- content="this is content, this is content, this is content">
|
|
|
|
- <el-button slot="reference">Click to activate</el-button>
|
|
|
|
-</el-popover>
|
|
|
|
|
|
+ <el-popover
|
|
|
|
+ placement="bottom"
|
|
|
|
+ title="Title"
|
|
|
|
+ width="200"
|
|
|
|
+ trigger="click"
|
|
|
|
+ content="this is content, this is content, this is content">
|
|
|
|
+ <el-button slot="reference">Click to activate</el-button>
|
|
|
|
+ </el-popover>
|
|
|
|
|
|
-<el-popover
|
|
|
|
- ref="popover"
|
|
|
|
- placement="right"
|
|
|
|
- title="Title"
|
|
|
|
- width="200"
|
|
|
|
- trigger="focus"
|
|
|
|
- content="this is content, this is content, this is content">
|
|
|
|
-</el-popover>
|
|
|
|
-<el-button v-popover:popover>Focus to activate</el-button>
|
|
|
|
|
|
+ <el-popover
|
|
|
|
+ ref="popover"
|
|
|
|
+ placement="right"
|
|
|
|
+ title="Title"
|
|
|
|
+ width="200"
|
|
|
|
+ trigger="focus"
|
|
|
|
+ content="this is content, this is content, this is content">
|
|
|
|
+ </el-popover>
|
|
|
|
+ <el-button v-popover:popover>Focus to activate</el-button>
|
|
|
|
+
|
|
|
|
+ <el-popover
|
|
|
|
+ placement="bottom"
|
|
|
|
+ title="Title"
|
|
|
|
+ width="200"
|
|
|
|
+ trigger="manual"
|
|
|
|
+ content="this is content, this is content, this is content"
|
|
|
|
+ v-model="visible">
|
|
|
|
+ <el-button slot="reference" @click="visible = !visible">Manual to activate</el-button>
|
|
|
|
+ </el-popover>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ visible: false
|
|
|
|
+ };
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+</script>
|
|
```
|
|
```
|
|
:::
|
|
:::
|
|
|
|
|