国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

vue使用screenfull插件實現全屏功能

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

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

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

npm install screenfull --save

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

<template> <el-tooltip effect='dark' content='全屏' placement='bottom'> <img @click='screen' :src='http://www.intensediesel.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>

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Vue
相關文章:
主站蜘蛛池模板: 仪征市| 内黄县| 江源县| 新泰市| 安图县| 阿城市| 察哈| 喀喇沁旗| 平潭县| 宜兰市| 腾冲县| 民和| 柯坪县| 和田县| 葵青区| 海淀区| 五指山市| 嵩明县| 古田县| 舞钢市| 勃利县| 白水县| 筠连县| 江安县| 玉山县| 札达县| 鹿邑县| 玉田县| 土默特右旗| 虎林市| 共和县| 二连浩特市| 梨树县| 洞头县| 洪江市| 大冶市| 平顶山市| 锦屏县| 江安县| 门源| 东乡|