Skip to content

Commit 90bddaf

Browse files
committed
Version 2.0.0 (Vue 3)
1 parent 8d86201 commit 90bddaf

19 files changed

+14366
-299
lines changed

.browserslistrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
> 1%
22
last 2 versions
3-
not ie <= 8
3+
not dead

.eslintrc.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module.exports = {
22
root: true,
33
env: {
4-
node: true
4+
node: true,
5+
},
6+
extends: ["plugin:vue/vue3-essential", "eslint:recommended", "@vue/prettier"],
7+
parserOptions: {
8+
parser: "babel-eslint",
59
},
6-
extends: ["plugin:vue/essential", "@vue/prettier"],
710
rules: {
8-
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
9-
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
11+
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
12+
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
1013
},
11-
parserOptions: {
12-
parser: "babel-eslint"
13-
}
1414
};

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.DS_Store
22
node_modules
3+
/dist
4+
35

46
# local env files
57
.env.local
@@ -9,6 +11,7 @@ node_modules
911
npm-debug.log*
1012
yarn-debug.log*
1113
yarn-error.log*
14+
pnpm-debug.log*
1215

1316
# Editor directories and files
1417
.idea
@@ -17,4 +20,4 @@ yarn-error.log*
1720
*.ntvs*
1821
*.njsproj
1922
*.sln
20-
*.sw*
23+
*.sw?

README.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
2+
# IMPORTANT
3+
**Version 2.0.0 of this plugin only works with Vue 3. If you need Vue 2 compatibility install version 1.0.0**
4+
5+
16
# vue-mobile-detection
2-
Vue.js prototype function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile
7+
Vue.js global function `this.$isMobile()` that returns a Boolean value depending on whether or not the user is browsing with a mobile
38

49
<p align="center">
510
<a href="https://www.npmjs.com/package/vue-mobile-detection"><img alt="NPM Version" src="https://img.shields.io/npm/v/vue-mobile-detection.svg?style=for-the-badge"></a>
@@ -15,7 +20,7 @@ https://ajerez.github.io/vue-mobile-detection/
1520

1621
#### With npm (Recommended)
1722
```bash
18-
npm install vue-mobile-detection
23+
npm i vue-mobile-detection
1924
```
2025

2126
#### yarn
@@ -30,7 +35,10 @@ yarn add vue-mobile-detection
3035
```vue
3136
3237
import VueMobileDetection from "vue-mobile-detection";
33-
Vue.use(VueMobileDetection);
38+
import App from "./App.vue";
39+
40+
const app = createApp(App);
41+
app.use(VueMobileDetection);
3442
3543
/* After the install you can use this.$isMobile() in all your vue components */
3644
```

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ["@vue/app"]
2+
presets: ["@vue/cli-plugin-babel/preset"],
33
};

0 commit comments

Comments
 (0)