mirror of https://github.com/ElemeFE/element
				
				
				
			Merge pull request #381 from QingWei-Li/fix/demo-footer
Popover: add popperClass; Steps: update style proppull/384/head^2
						commit
						d41f602580
					
				| 
						 | 
				
			
			@ -11,7 +11,7 @@
 | 
			
		|||
          ref="weixin"
 | 
			
		||||
          placement="top"
 | 
			
		||||
          width="120"
 | 
			
		||||
          class="footer-popover"
 | 
			
		||||
          popper-class="footer-popover"
 | 
			
		||||
          trigger="hover">
 | 
			
		||||
          <div class="footer-popover-title">饿了么 UED</div>
 | 
			
		||||
          <img src="../assets/images/qrcode.png" alt="">
 | 
			
		||||
| 
						 | 
				
			
			@ -71,29 +71,6 @@
 | 
			
		|||
      float: right;
 | 
			
		||||
      line-height: 120px;
 | 
			
		||||
 | 
			
		||||
      .footer-popover {
 | 
			
		||||
        .el-popover {
 | 
			
		||||
          padding: 0;
 | 
			
		||||
          min-width: 120px;
 | 
			
		||||
          line-height: normal;
 | 
			
		||||
          box-shadow: 0 0 11px 0 rgba(174, 187, 211, 0.24);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        .footer-popover-title {
 | 
			
		||||
          border-bottom: solid 1px #eaeefb;
 | 
			
		||||
          height: 30px;
 | 
			
		||||
          line-height: 30px;
 | 
			
		||||
          text-align: center;
 | 
			
		||||
          color: #99a9bf;
 | 
			
		||||
          background-color: #f8f9fe;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        img {
 | 
			
		||||
          size: 100px;
 | 
			
		||||
          margin: 10px;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
      .elementdoc {
 | 
			
		||||
        transition: .3s;
 | 
			
		||||
        display: inline-block;
 | 
			
		||||
| 
						 | 
				
			
			@ -124,4 +101,25 @@
 | 
			
		|||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  .footer-popover {
 | 
			
		||||
    padding: 0;
 | 
			
		||||
    min-width: 120px;
 | 
			
		||||
    line-height: normal;
 | 
			
		||||
    box-shadow: 0 0 11px 0 rgba(174, 187, 211, 0.24);
 | 
			
		||||
 | 
			
		||||
    .footer-popover-title {
 | 
			
		||||
      border-bottom: solid 1px #eaeefb;
 | 
			
		||||
      height: 30px;
 | 
			
		||||
      line-height: 30px;
 | 
			
		||||
      text-align: center;
 | 
			
		||||
      color: #99a9bf;
 | 
			
		||||
      background-color: #f8f9fe;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    img {
 | 
			
		||||
      size: 100px;
 | 
			
		||||
      margin: 10px;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
</style>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -208,6 +208,7 @@ Popover 的属性与 Tooltip 很类似,它们都是基于`Vue-popper`开发的
 | 
			
		|||
|  transition     |  定义渐变动画      | String             | — | fade-in-linear |
 | 
			
		||||
|  visible-arrow   |  是否显示 Tooltip 箭头,更多参数可见[Vue-popper](https://github.com/element-component/vue-popper) | Boolean | — | true |
 | 
			
		||||
|  options        | [popper.js](https://popper.js.org/documentation.html) 的参数 | Object            | 参考 [popper.js](https://popper.js.org/documentation.html) 文档 | `{ boundariesElement: 'body', gpuAcceleration: false }` |
 | 
			
		||||
| popper-class | 为 popper 添加类名 | String | - | -|
 | 
			
		||||
 | 
			
		||||
### Slot
 | 
			
		||||
| 参数               | 说明                                                     |
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,6 +3,7 @@
 | 
			
		|||
    <transition :name="transition" @after-leave="doDestroy">
 | 
			
		||||
      <div
 | 
			
		||||
        class="el-popover"
 | 
			
		||||
        :class="[popperClass]"
 | 
			
		||||
        ref="popper"
 | 
			
		||||
        v-show="showPopper"
 | 
			
		||||
        :style="{ width: width + 'px' }">
 | 
			
		||||
| 
						 | 
				
			
			@ -39,6 +40,7 @@ export default {
 | 
			
		|||
    title: String,
 | 
			
		||||
    content: String,
 | 
			
		||||
    reference: {},
 | 
			
		||||
    popperClass: String,
 | 
			
		||||
    width: {},
 | 
			
		||||
    visibleArrow: {
 | 
			
		||||
      default: true
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -60,8 +60,8 @@ export default {
 | 
			
		|||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      index: -1,
 | 
			
		||||
      style: { width: '', height: '' },
 | 
			
		||||
      lineStyle: { width: '', height: '' },
 | 
			
		||||
      style: {},
 | 
			
		||||
      lineStyle: {},
 | 
			
		||||
      mainOffset: 0,
 | 
			
		||||
      currentStatus: this.status
 | 
			
		||||
    };
 | 
			
		||||
| 
						 | 
				
			
			@ -88,18 +88,21 @@ export default {
 | 
			
		|||
 | 
			
		||||
    calcProgress(status) {
 | 
			
		||||
      let step = 100;
 | 
			
		||||
      const style = {};
 | 
			
		||||
 | 
			
		||||
      this.lineStyle.transitionDelay = 150 * this.index + 'ms';
 | 
			
		||||
      style.transitionDelay = 150 * this.index + 'ms';
 | 
			
		||||
      if (status === this.$parent.processStatus) {
 | 
			
		||||
        step = 50;
 | 
			
		||||
      } else if (status === 'wait') {
 | 
			
		||||
        step = 0;
 | 
			
		||||
        this.lineStyle.transitionDelay = (-150 * this.index) + 'ms';
 | 
			
		||||
        style.transitionDelay = (-150 * this.index) + 'ms';
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.$parent.direction === 'vertical'
 | 
			
		||||
        ? this.lineStyle.height = step + '%'
 | 
			
		||||
        : this.lineStyle.width = step + '%';
 | 
			
		||||
        ? style.height = step + '%'
 | 
			
		||||
        : style.width = step + '%';
 | 
			
		||||
 | 
			
		||||
      this.lineStyle = style;
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue