最新国产好看的视频,伊人天堂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)論

大埔区| 镇雄县| 漳州市| 依安县| 平遥县| 正安县| 英吉沙县| 宜良县| 阿拉善盟| 平乡县| 金门县| 娱乐| 高陵县| 孟连| 盱眙县| 吴堡县| 武强县| 始兴县| 永顺县| 卢氏县| 新沂市| 清苑县| 罗平县| 西青区| 六盘水市| 灵璧县| 香港| 上虞市| 郎溪县| 柘城县| 高阳县| 石家庄市| 丰顺县| 威远县| 襄汾县| 宁南县| 无极县| 凤阳县| 稻城县| 河东区| 广昌县|