From c293847c51327d16b45815c9a8ee422bbb91a54a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=B1=E7=9C=A0=E4=BB=AA=E5=BC=8F?= <854085467@qq.com> Date: Thu, 25 Feb 2021 14:21:03 +0800 Subject: [PATCH] add common.isModile() api pe support function --- component/pear/modules/common.js | 11 +++++++++++ view/system/user.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/component/pear/modules/common.js b/component/pear/modules/common.js index d383608..6f1eac8 100644 --- a/component/pear/modules/common.js +++ b/component/pear/modules/common.js @@ -29,6 +29,17 @@ layui.define(['jquery', 'element','table'], function(exports) { return ids; } + /** + * 当前是否为与移动端 + * */ + this.isModile = function(){ + if ($(window).width() <= 768) { + return true; + } + return false; + } + + /** * 提交 json 数据 * @param data 提交数据 diff --git a/view/system/user.html b/view/system/user.html index 38288ea..def3343 100644 --- a/view/system/user.html +++ b/view/system/user.html @@ -201,7 +201,7 @@ type: 2, title: '新增', shade: 0.1, - area: ['500px', '400px'], + area: [common.isModile()?'100%':'500px', common.isModile()?'100%':'400px'], content: MODULE_PATH + 'add.html' }); }