U_can

Results 1 comments of U_can

### 需求分析: - 组件可设置弹出位置(placement),支持top、bottom - 气泡弹窗弹出位置计算,边界计算,支持设置边界范围 - 支持点击弹窗元素之外的区域,弹窗关闭 - 支持弹窗内容自定义 - 效果预览: ![post-img11](https://user-images.githubusercontent.com/15976830/124218345-a0568200-db2c-11eb-8dae-9078cb52e680.gif) ### 实现方案 实现自定义组件, 我们一般都会想到``Vue.extend``,``vue.extend``相当于一个扩展实例构造器,用于创建一个具有初始化选项的Vue子类,在实例化时可以进行扩展选项,最后使用$mount方法绑定在元素上。 #### 先写一个简单的demo - 编写index.vue文件 ```vue {{ txt }} export default { name: 'Popover',...