久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

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

瀏覽:2日期:2022-11-21 15:36:51

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

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

npm install screenfull --save

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

<template> <el-tooltip effect='dark' content='全屏' placement='bottom'> <img @click='screen' :src='http://m.baoyu77737.com/bcjs/require(’@/assets/images/screenful.png’)' : :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 : :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>

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Vue
相關(guān)文章:
主站蜘蛛池模板: 兰州市| 洪雅县| 铁岭市| 临江市| 仁布县| 祁东县| 吴桥县| 镇雄县| 犍为县| 高邑县| 镇巴县| 邛崃市| 合阳县| 松溪县| 阿拉善盟| 确山县| 扎鲁特旗| 敦化市| 镇康县| 法库县| 赤壁市| 屯留县| 屏东市| 天津市| 乐业县| 合肥市| 博乐市| 偏关县| 广宁县| 韶关市| 汉中市| 政和县| 岳普湖县| 武夷山市| 霍林郭勒市| 新泰市| 商洛市| 柘城县| 郎溪县| 岳池县| 龙里县|