2019-12-03 18:36:21 +08:00
|
|
|
# Manually Positioned
|
2020-03-08 19:24:07 +08:00
|
|
|
Click it.
|
2019-12-03 18:36:21 +08:00
|
|
|
```html
|
|
|
|
<div style="width: 200px; height: 200px; background-color: rgba(0, 128, 0, .5);" @click="handleClick"></div>
|
2020-09-10 14:18:02 +08:00
|
|
|
<n-popover :show="showPopover" :x="x" :y="y" manually-positioned>
|
2020-01-30 17:38:14 +08:00
|
|
|
Cool!
|
2019-12-03 18:36:21 +08:00
|
|
|
</n-popover>
|
|
|
|
```
|
|
|
|
```js
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
handleClick(e) {
|
2020-01-22 16:29:34 +08:00
|
|
|
if (this.showPopover) {
|
|
|
|
this.showPopover = false
|
|
|
|
} else {
|
2019-12-03 18:36:21 +08:00
|
|
|
this.showPopover = true
|
|
|
|
this.x = e.clientX
|
|
|
|
this.y = e.clientY
|
2020-01-22 16:29:34 +08:00
|
|
|
}
|
2019-12-03 18:36:21 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
showPopover: false,
|
|
|
|
x: 0,
|
|
|
|
y: 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|