最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue使用screenfull插件實(shí)現(xiàn)全屏功能

 更新時(shí)間:2020年09月17日 09:50:17   作者:lt要努力  
這篇文章主要為大家詳細(xì)介紹了vue使用screenfull插件實(shí)現(xiàn)全屏功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了vue使用screenfull插件實(shí)現(xiàn)全屏功能的具體代碼,供大家參考,具體內(nèi)容如下

1、安裝screenfull.js插件(在npm官網(wǎng)上有)

npm install screenfull --save

2、在vue項(xiàng)目中 src/components/ScreenFull/index.vue(寫成公共組件)

<template>
 <el-tooltip effect="dark" content="全屏" placement="bottom">
  <img @click="screen" class="pointer" :src="require('@/assets/images/screenful.png')" :width="width" :height="height">
 </el-tooltip>
</template>

<script>
import screenfull from 'screenfull'
export default {
 name: 'screenful',
 components: {
 },
 props: {
  width: {
   type: Number,
   default: 20
  },
  height: {
   type: Number,
   default: 20
  }
 },
 data() {
  return {
  }
 },
 computed: {
 },
 watch: {
 },
 methods: {
  screen() {
   if (!screenfull.isEnabled) {
    this.$message({
     message: 'you browser can not work',
     type: 'warning'
    })
    return false
   }
   screenfull.toggle()
  }
 },
 created() {
 },
 mounted() {
 }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less" scoped>
</style>

3、使用screenful組件

<template>
  <screenfull class="ml64" :width="20" :height="20"></screenfull>
</template>
<script>
import screenfull from '@/components/ScreenFull'
export default {
 name: 'navbar',
 components: {
  screenfull
 },
 data() {
  return {
  }
 },
 computed: {
 },
 watch: {
 },
 methods: {
 },
 created() {
 },
 mounted() {
 }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less" scoped>
</style>

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論

柳河县| 枣庄市| 防城港市| 夏河县| 南投县| 烟台市| 平果县| 佛坪县| 辽宁省| 威海市| 民县| 桑日县| 康平县| 格尔木市| 乌拉特后旗| 芮城县| 岳阳县| 五华县| 南丹县| 宿松县| 星子县| 焦作市| 庆云县| 襄樊市| 新余市| 贺兰县| 固始县| 望江县| 肥西县| 崇义县| 交口县| 志丹县| 贵港市| 万安县| 莫力| 仁怀市| 清丰县| 西充县| 聊城市| 延长县| 库车县|