| Server IP : 34.87.99.72 / Your IP : 216.73.217.31 Web Server : Apache/2.4.46 (Unix) OpenSSL/1.1.1n System : Linux zlock-bitnami-lamp-prod-v2-vm 4.19.0-16-cloud-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 User : bitnami ( 1000) PHP Version : 7.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /opt/bitnami/apache/htdocs/app/node_modules/vuetify/src/mixins/mobile/ |
Upload File : |
// Types
import { BreakpointName } from 'vuetify/types/services/breakpoint'
import { deprecate } from '../../util/console'
import Vue, { PropType } from 'vue'
/* @vue/component */
export default Vue.extend({
name: 'mobile',
props: {
mobileBreakpoint: {
type: [Number, String] as PropType<number | BreakpointName>,
default (): number | BreakpointName | undefined {
// Avoid destroying unit
// tests for users
return this.$vuetify
? this.$vuetify.breakpoint.mobileBreakpoint
: undefined
},
validator: v => (
!isNaN(Number(v)) ||
['xs', 'sm', 'md', 'lg', 'xl'].includes(String(v))
),
},
},
computed: {
isMobile (): boolean {
const {
mobile,
width,
name,
mobileBreakpoint,
} = this.$vuetify.breakpoint
// Check if local mobileBreakpoint matches
// the application's mobileBreakpoint
if (mobileBreakpoint === this.mobileBreakpoint) return mobile
const mobileWidth = parseInt(this.mobileBreakpoint, 10)
const isNumber = !isNaN(mobileWidth)
return isNumber
? width < mobileWidth
: name === this.mobileBreakpoint
},
},
created () {
/* istanbul ignore next */
if (this.$attrs.hasOwnProperty('mobile-break-point')) {
deprecate('mobile-break-point', 'mobile-breakpoint', this)
}
},
})