From 53946102e83b736ca76d2c6c2fb0e11d3c3dd2fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Tue, 28 May 2019 17:48:05 +0800 Subject: [PATCH] [Doc] add touch emulator guide --- docs/markdown/quickstart.zh-CN.md | 13 +++++++++++++ docs/src/mobile.js | 2 +- package.json | 1 + yarn.lock | 5 +++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/markdown/quickstart.zh-CN.md b/docs/markdown/quickstart.zh-CN.md index 87f6af320..fb7f9b9ac 100644 --- a/docs/markdown/quickstart.zh-CN.md +++ b/docs/markdown/quickstart.zh-CN.md @@ -153,3 +153,16 @@ module.exports = { ``` > 注意:在配置 postcss-loader 时,应避免 ignore node_modules 目录,这会导致 Vant 的样式无法被编译 + +### 在桌面端使用 + +Vant 组件默认只适配了移动端设备,如果你需要在桌面端使用 vant,可以引入我们提供的 [@vant/touch-emulator](https://github.com/chenjiahan/vant-touch-emulator). + +```bash +npm i @vant/touch-emulator -S +``` + +```js +// 引入模块后自动生效 +import '@vant/touch-emulator'; +``` diff --git a/docs/src/mobile.js b/docs/src/mobile.js index a3ab59b53..8c9f5aab0 100644 --- a/docs/src/mobile.js +++ b/docs/src/mobile.js @@ -4,7 +4,7 @@ import VueRouter from 'vue-router'; import { progress } from '@vant/doc'; import App from './WapApp'; import routes from './router'; -import '@vant/doc/helper/touch-simulator'; +import '@vant/touch-emulator'; const router = new VueRouter({ mode: 'hash', diff --git a/package.json b/package.json index 13839d9d3..f55441d13 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "@vant/doc": "^2.2.4", "@vant/eslint-config": "^1.1.2", "@vant/markdown-loader": "^2.0.0", + "@vant/touch-emulator": "^1.0.0", "@vue/babel-preset-jsx": "^1.0.0", "@vue/server-test-utils": "^1.0.0-beta.29", "@vue/test-utils": "^1.0.0-beta.29", diff --git a/yarn.lock b/yarn.lock index 714cc3128..2e89eb899 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1109,6 +1109,11 @@ highlight.js "^9.15.6" markdown-it "^8.4.2" +"@vant/touch-emulator@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@vant/touch-emulator/-/touch-emulator-1.0.0.tgz#e9ea133fd874a534481c84e12089b2e9d552544b" + integrity sha512-XDiQ4Cp7uU1PjsNwyXBymnH6f1I0hwEGa0HN0fvGstP7oFb8QGICUNMiNV0PHmYiBdql60lk1oTGi+refLypGQ== + "@vue/babel-helper-vue-jsx-merge-props@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@vue/babel-helper-vue-jsx-merge-props/-/babel-helper-vue-jsx-merge-props-1.0.0.tgz#048fe579958da408fb7a8b2a3ec050b50a661040"