no message

Former-commit-id: 4c38f2bd200ccd90eb4dc0f3367d67d7cb47d1b1 [formerly 4c38f2bd200ccd90eb4dc0f3367d67d7cb47d1b1 [formerly 4c38f2bd200ccd90eb4dc0f3367d67d7cb47d1b1 [formerly 4c38f2bd200ccd90eb4dc0f3367d67d7cb47d1b1 [formerly d8e1aaf4c26758680dc4cd5b51db886ffd86739e [formerly d0781c0d13d71384cd307e564a6176e64e49e7a0]]]]]
Former-commit-id: 26b2872a282b3ccb01e328b200411719aaf176fd
Former-commit-id: 143fdba770bf4ca1e72fb274470539ac7b6137dd
Former-commit-id: 63cee2802670283c503adb7e81084dc675523d55 [formerly f77bebb96c5377ade8f8adbd0bb0c7c30cf5b7c0]
Former-commit-id: 48161dd47c512e4036d37d658a2b166c2934e493
Former-commit-id: dd9be6e4aa02bd20895f2afdaf1a4b7e33af2539
Former-commit-id: 5be876509b54638f6e4e7ec60beddcbda54d8d1f
Former-commit-id: 9a6fd0bf985b7090c23f1a3364137a1b2155af32
Former-commit-id: 70ca09c855926f74e60451e5b60581a29a708abd
This commit is contained in:
liyang
2018-06-19 13:51:09 +08:00
parent c42ad45923
commit 487ef6fd52
4 changed files with 22 additions and 3 deletions

View File

@@ -9,6 +9,12 @@
| type | 容器类型 | 非 | String | card ghost full | card |
| responsive | 响应式宽度 | 非 | Boolean | | false |
## 事件
| 事件名 | 介绍 | 回调参数 |
| --- | --- | --- |
| resized | type 为 full 时页面完成尺寸计算会触发此事件 | |
::: tip
`responsive` 参数设置只在 `type` 等于 `card``ghost` 时生效
:::

View File

@@ -47,6 +47,9 @@ export default {
mounted () {
this.headerHeight = this.$slots.header ? this.$refs.header.offsetHeight : 0
this.footerHeight = this.$slots.footer ? this.$refs.footer.offsetHeight : 0
this.$nextTick(() => {
this.$emit('resized')
})
},
computed: {
cardStyle () {

View File

@@ -11,7 +11,7 @@
<slot/>
</div>
<!-- [container-full] 撑满 -->
<d2-container-full v-if="type === 'full'" :right="20" :bottom="0">
<d2-container-full v-if="type === 'full'" :right="20" :bottom="0" @resized="$emit('resized')">
<slot v-if="$slots.header" name="header" slot="header"/>
<slot/>
<slot v-if="$slots.footer" name="footer" slot="footer"/>

View File

@@ -1,9 +1,9 @@
<template>
<d2-container type="full">
<d2-container type="full" @resized="handleResize">
<template slot="header">滚动定位</template>
<el-row :gutter="20">
<el-col :span="8">
<div ref="wrapper" class="demo-bs-wrapper d2-mb">
<div ref="wrapper" class="demo-bs-wrapper">
<div>
<div v-for="n in 100" :key="n" class="demo-bs-item" :id="`demo-bs-item-${n}`">n : {{n}}</div>
</div>
@@ -35,6 +35,9 @@
</div>
</el-col>
</el-row>
<template slot="footer">
<d2-demo-link-btn title="相关文档" link="http://ustbhuangyi.github.io/better-scroll/doc/zh-hans/"/>
</template>
</d2-container>
</template>
@@ -54,8 +57,15 @@ export default {
fade: true
}
})
const a = 'abc'
const b = 'abc'
console.log(a == b)
console.log(a === b)
},
methods: {
handleResize () {
this.BS.refresh()
},
handleScrollTo (y) {
this.BS.scrollTo(0, -y, this.time)
},