在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
例如:vue-fullscreen <template> <div class="Test"> <fullscreen ref="fullscreen" @change="fullscreenChange" > <el-button @click="toggle">全屏</el-button> something </fullscreen> </div> </template> <script lang="ts"> import { Vue, Component, Prop, Watch } from 'vue-property-decorator';// @ts-ignore import fullscreen from 'vue-fullscreen'; Vue.use(fullscreen); @Component({}) export default class Test extends Vue { toggle() { (this.$refs.fullscreen as fullscreen).toggle(); // !!!! as后面的fullscreen是引入后组件的名称 } fullscreenChange(status: boolean) { this.fullscreen = status; } } </script> <style lang="less" scoped> .Test{} </style>
|
请发表评论