1.0.0 • Published 2 years ago

@hyhello/vue-fullscreen v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Quick start

@hyhello/vue-fullscreen

The @hyhello/vue-fullscreen component for vue2, supports single page applications.

Read this document in: 简体中文.

Examples

codepen.io

Use Setup

install @hyhello/vue-fullscreen

npm install @hyhello/vue-fullscreen --save

Vue mount

// global use
import Vue from 'vue';
import vueFullscreen from '@hyhello/vue-fullscreen';

// use  @params:global configuration
Vue.use(vueFullscreen, [options]);

// or Local use
import { Fullscreen } from '@hyhello/vue-fullscreen';

export default {
    components: { Fullscreen }
};

Use in SPA

<template>
	<div>
		<div class="bindEl">content</div>
		<vue-fullscreen bind=".bindEl" @change="change" :native-options="options">
			<button>fullscreen toggle</button>
		</vue-fullscreen>
	</div>
</template>
<script>
	import { Fullscreen as vueFullscreen } from '@hyhello/vue-fullscreen';

	export default {
		components: { vueFullscreen },
		data: function () {
			return {
				options: {
					navigationUI: 'hide'
				}
			};
		},
		methods: {
			change(val) {
				console.log('status:', val ? 'fullscreen' : 'no fullscreen');
			}
		}
	};
</script>

Api

Attributes

paramsexplaintypeOptional valueDefault value
bindBind elements that need to be enlargedstring / HTMLElement / functiondocument.documentElement
triggerTriggered methodsstringclick / dblclickclick
nativeOptionsAn object that controls the behavior of the transition to full screen mode,Apiobject{}
keyboardEnable keyboard control(F11)booleantrue
beforeChangeTrigger before changefunction

Events

eventNameexplainCallback Arguments
changeMonitor whether the current screen is fullstatus(boolean)
1.0.0

2 years ago

0.0.7

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago