From 2fe99d031abea86349e8b652ce655dd0a98d8a51 Mon Sep 17 00:00:00 2001 From: cookfront Date: Thu, 9 Mar 2017 20:29:41 +0800 Subject: [PATCH] popup component demo --- build/webpack.config.js | 3 +- docs/components/mobile-computed.js | 19 +++++++++++++ docs/components/mobile-popup.vue | 45 ++++++++++++++++++++++++++++++ docs/examples-dist/dialog.vue | 19 ++++++++++++- docs/examples-dist/field.vue | 21 +++++++++++--- docs/examples-dist/icon.vue | 33 ++++++++++++++++++++++ docs/examples-dist/popup.vue | 31 ++++++++++++++------ docs/examples-docs/actionsheet.md | 9 ++++++ docs/examples-docs/dialog.md | 25 +++++++++++++++++ docs/examples-docs/popup.md | 36 ++++++++++++++++++------ 10 files changed, 219 insertions(+), 22 deletions(-) create mode 100644 docs/components/mobile-computed.js create mode 100644 docs/components/mobile-popup.vue create mode 100644 docs/examples-dist/icon.vue diff --git a/build/webpack.config.js b/build/webpack.config.js index 06f6c5859..1d311de95 100644 --- a/build/webpack.config.js +++ b/build/webpack.config.js @@ -43,7 +43,8 @@ module.exports = { 'zanui': path.join(__dirname, '..'), 'src': path.join(__dirname, '../src'), 'packages': path.join(__dirname, '../packages'), - 'lib': path.join(__dirname, '../lib') + 'lib': path.join(__dirname, '../lib'), + 'components': path.join(__dirname, '../docs/components') } }, module: { diff --git a/docs/components/mobile-computed.js b/docs/components/mobile-computed.js new file mode 100644 index 000000000..fafec730d --- /dev/null +++ b/docs/components/mobile-computed.js @@ -0,0 +1,19 @@ +import MobilePopup from 'components/mobile-popup.vue'; + +export default { + components: { + MobilePopup + }, + + computed: { + mobileUrl() { + return '/examples.html' + location.hash; + } + }, + + data() { + return { + mobileShow: false + }; + } +}; diff --git a/docs/components/mobile-popup.vue b/docs/components/mobile-popup.vue new file mode 100644 index 000000000..fb8b7f4e6 --- /dev/null +++ b/docs/components/mobile-popup.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/docs/examples-dist/dialog.vue b/docs/examples-dist/dialog.vue index 84234f0c7..fdcd93c61 100644 --- a/docs/examples-dist/dialog.vue +++ b/docs/examples-dist/dialog.vue @@ -6,12 +6,29 @@ - + \ No newline at end of file +import Vue from "vue";import ExampleBlock from "../components/example-block";Vue.component("example-block", ExampleBlock); +export default { + data() { + return { + username: 'zhangmin' + }; + } +}; + \ No newline at end of file diff --git a/docs/examples-dist/icon.vue b/docs/examples-dist/icon.vue new file mode 100644 index 000000000..ed8d981e1 --- /dev/null +++ b/docs/examples-dist/icon.vue @@ -0,0 +1,33 @@ + + + \ No newline at end of file diff --git a/docs/examples-dist/popup.vue b/docs/examples-dist/popup.vue index e928446d9..21ebd7bfc 100644 --- a/docs/examples-dist/popup.vue +++ b/docs/examples-dist/popup.vue @@ -1,9 +1,9 @@ \ No newline at end of file diff --git a/docs/examples-docs/actionsheet.md b/docs/examples-docs/actionsheet.md index ff6021f63..9918c4945 100644 --- a/docs/examples-docs/actionsheet.md +++ b/docs/examples-docs/actionsheet.md @@ -17,7 +17,11 @@ @@ -52,10 +66,10 @@ export default { :::demo 基础用法 ```html
- 从下方弹出popup + 从下方弹出popup
- 从中间弹出popup + 更新成功
@@ -101,9 +115,15 @@ export default { } }; + ``` ::: +点击以下按钮查看手机端效果: + +点击查看手机端效果 + + ### API | 参数 | 说明 | 类型 | 默认值 | 可选值 |