1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<template>
<div class="wrapper" ref="wrapper">
<div class="content">
<slot></slot>
</div>
</div>
</template>
<script lang='ts'>
import Vue from "vue";
import { Component } from "vue-property-decorator";
import BScroll from "better-scroll";
@Component
export default class Scroll extends Vue {
scroll: any;
mounted() {
{
// 创建scroll对象
this.scroll = new BScroll(this.$refs.wrapper as any, {
click: true // betterscroll默认不监听浏览器的原生click,加上true即可监听
});
}
}
}
</script>
|