Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
京东前端
nutui
提交
f718cd60
N
nutui
项目概览
京东前端
/
nutui
通知
37
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
nutui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
f718cd60
编写于
2月 07, 2023
作者:
Y
yangxiaolu3
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: overlay
上级
9fd4ea09
变更
23
展开全部
隐藏空白更改
内联
并排
Showing
23 changed file
with
218 addition
and
78 deletion
+218
-78
miniprogram_dev/components/packages/button/index.js
miniprogram_dev/components/packages/button/index.js
+2
-2
miniprogram_dev/components/packages/button/index.js.map
miniprogram_dev/components/packages/button/index.js.map
+1
-1
miniprogram_dev/components/packages/overlay/index.js
miniprogram_dev/components/packages/overlay/index.js
+11
-19
miniprogram_dev/components/packages/overlay/index.js.map
miniprogram_dev/components/packages/overlay/index.js.map
+1
-1
miniprogram_dev/components/packages/overlay/index.json
miniprogram_dev/components/packages/overlay/index.json
+3
-1
miniprogram_dev/components/packages/overlay/index.wxml
miniprogram_dev/components/packages/overlay/index.wxml
+9
-9
miniprogram_dev/components/packages/transition/index.js
miniprogram_dev/components/packages/transition/index.js
+2
-2
miniprogram_dev/components/packages/transition/index.js.map
miniprogram_dev/components/packages/transition/index.js.map
+1
-1
miniprogram_dev/components/packages/transition/index.wxml
miniprogram_dev/components/packages/transition/index.wxml
+1
-1
miniprogram_dev/package.json
miniprogram_dev/package.json
+1
-1
miniprogram_dev/pages/basic/pages/overlay/index.js
miniprogram_dev/pages/basic/pages/overlay/index.js
+44
-1
miniprogram_dev/pages/basic/pages/overlay/index.wxml
miniprogram_dev/pages/basic/pages/overlay/index.wxml
+26
-3
miniprogram_dev/pages/basic/pages/overlay/index.wxss
miniprogram_dev/pages/basic/pages/overlay/index.wxss
+11
-0
miniprogram_dev/pages/basic/pages/transition/index.wxml
miniprogram_dev/pages/basic/pages/transition/index.wxml
+1
-1
src/packages/button/index.ts
src/packages/button/index.ts
+2
-2
src/packages/overlay/index.json
src/packages/overlay/index.json
+3
-1
src/packages/overlay/index.ts
src/packages/overlay/index.ts
+7
-17
src/packages/overlay/index.wxml
src/packages/overlay/index.wxml
+9
-9
src/packages/transition/index.wxml
src/packages/transition/index.wxml
+1
-1
tools/demo/pages/basic/pages/overlay/index.js
tools/demo/pages/basic/pages/overlay/index.js
+44
-1
tools/demo/pages/basic/pages/overlay/index.wxml
tools/demo/pages/basic/pages/overlay/index.wxml
+26
-3
tools/demo/pages/basic/pages/overlay/index.wxss
tools/demo/pages/basic/pages/overlay/index.wxss
+11
-0
tools/demo/pages/basic/pages/transition/index.wxml
tools/demo/pages/basic/pages/transition/index.wxml
+1
-1
未找到文件。
miniprogram_dev/components/packages/button/index.js
浏览文件 @
f718cd60
...
...
@@ -221,8 +221,8 @@ var _component = __webpack_require__(0);
},
methods
:
{
handleClick
:
function
handleClick
()
{
if
(
!
this
.
props
.
loading
&&
!
this
.
props
.
disabled
)
{
this
.
$emit
(
'
click
'
,
event
);
if
(
!
this
.
data
.
loading
&&
!
this
.
data
.
disabled
)
{
this
.
$emit
(
'
click
'
);
}
}
}
...
...
miniprogram_dev/components/packages/button/index.js.map
浏览文件 @
f718cd60
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/common/component.ts","webpack:///./src/mixins/basic.ts","webpack:///./src/packages/button/index.ts"],"names":[],"mappings":";;Q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;AAFH,SAlBD;AAsBL,cAAM;AACJ,kBAAM,MADF;AAEJ,mBAAO;AAFH,SAtBD;AA0BL,eAAO;AACL,kBAAM,OADD;AAEL,mBAAO;AAFF,SA1BF;AA8BL,cAAM;AACJ,kBAAM,MADF;AAEJ,mBAAO;AAFH,SA9BD;AAkCL,yBAAiB;AACf,kBAAM,MADS;AAEf,mBAAO;AAFQ,SAlCZ;AAsCL,2BAAmB;AACjB,kBAAM,MADW;AAEjB,mBAAO;AAFU;AAtCd,KADI;AA6CX,aAAS;AACP,mBADO,yBACI;AACT,gBAAI,CAAC,KAAK,KAAL,CAAW,OAAZ,IAAuB,CAAC,KAAK,KAAL,CAAW,QAAvC,EAAiD;AAC/C,qBAAK,KAAL,CAAW,OAAX,EAAoB,KAApB;AACD;AACF;AALM;AA7CE,CAAb,E","file":"packages/button/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","import { basic } from '../mixins/basic.ts';\nimport { NutComponentOptions } from '../definitions/index.ts';\n\nfunction mapKeys(\n source: Record<string, any>,\n target: Record<string, any>,\n map: Record<string, any>\n) {\n Object.keys(map).forEach((key) => {\n if (source[key]) {\n target[map[key]] = source[key];\n }\n });\n}\n\nfunction NutComponent<\n Data extends WechatMiniprogram.Component.DataOption,\n Props extends WechatMiniprogram.Component.PropertyOption,\n Methods extends WechatMiniprogram.Component.MethodOption\n>(NutOptions: NutComponentOptions<Data, Props, Methods>): void {\n const options: WechatMiniprogram.Component.Options<Data, Props, Methods> = {};\n\n mapKeys(NutOptions, options, {\n data: 'data',\n props: 'properties',\n mixins: 'behaviors',\n methods: 'methods',\n beforeCreate: 'created',\n created: 'attached',\n mounted: 'ready',\n destroyed: 'detached',\n classes: 'externalClasses',\n observers: 'observers'\n });\n\n // add default externalClasses\n options.externalClasses = options.externalClasses || [];\n options.externalClasses.push('custom-class');\n\n // add default behaviors\n options.behaviors = options.behaviors || [];\n options.behaviors.push(basic);\n\n // add relations\n const { relation } = NutOptions;\n if (relation) {\n options.relations = relation.relations;\n options.behaviors.push(relation.mixin);\n }\n \n // map field to form-field behavior\n if (NutOptions.field) {\n options.behaviors.push('wx://form-field');\n }\n\n // add default options\n options.options = {\n multipleSlots: true,\n addGlobalClass: true,\n };\n\n console.log(options)\n\n Component(options);\n}\n\n\nmodule.exports = { NutComponent };\n","export const basic = Behavior({\n methods: {\n $emit(\n name: string,\n detail?: Record<string, unknown>,\n options?: WechatMiniprogram.Component.TriggerEventOption\n ) {\n this.triggerEvent(name, detail, options);\n },\n \n set(data: Record<string, unknown>) {\n this.setData(data);\n \n return new Promise((resolve) => wx.nextTick(resolve));\n },\n },\n });\n ","import { NutComponent } from './../../common/component.ts'\r\n\r\nNutComponent({\r\n props: {\r\n color: String,\r\n shape: {\r\n type: String,\r\n value: 'round'\r\n },\r\n plain: {\r\n type: Boolean,\r\n value: false\r\n },\r\n loading: {\r\n type: Boolean,\r\n value: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n value: false\r\n },\r\n type: {\r\n type: String,\r\n value: 'default'\r\n },\r\n size: {\r\n type: String,\r\n value: 'normal'\r\n },\r\n block: {\r\n type: Boolean,\r\n value: false\r\n },\r\n icon: {\r\n type: String,\r\n value: ''\r\n },\r\n iconClassPrefix: {\r\n type: String,\r\n value: 'nut-icon'\r\n },\r\n iconFontClassName: {\r\n type: String,\r\n value: 'nutui-iconfont'\r\n }\r\n },\r\n\r\n methods: {\r\n handleClick() {\r\n if (!this.props.loading && !this.props.disabled) {\r\n this.$emit('click', event);\r\n }\r\n },\r\n },\r\n});\r\n"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/common/component.ts","webpack:///./src/mixins/basic.ts","webpack:///./src/packages/button/index.ts"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AC/EA,SAAS,OAAT,CACE,MADF,EAEE,MAFF,EAGE,GAHF,EAG0B;AAExB,WAAO,IAAP,CAAY,GAAZ,EAAiB,OAAjB,CAAyB,UAAC,GAAD,EAAQ;AAC/B,YAAI,OAAO,GAAP,CAAJ,EAAiB;AACf,mBAAO,IAAI,GAAJ,CAAP,IAAmB,OAAO,GAAP,CAAnB;AACD;AACF,KAJD;AAKD;AAED,SAAS,YAAT,CAIE,UAJF,EAIuD;AACrD,QAAM,UAAqE,EAA3E;AAEA,YAAQ,UAAR,EAAoB,OAApB,EAA6B;AAC3B,cAAM,MADqB;AAE3B,eAAO,YAFoB;AAG3B,gBAAQ,WAHmB;AAI3B,iBAAS,SAJkB;AAK3B,sBAAc,SALa;AAM3B,iBAAS,UANkB;AAO3B,iBAAS,OAPkB;AAQ3B,mBA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L,kBAAM,OADD;AAEL,mBAAO;AAFF,SANF;AAUL,iBAAS;AACP,kBAAM,OADC;AAEP,mBAAO;AAFA,SAVJ;AAcL,kBAAU;AACR,kBAAM,OADE;AAER,mBAAO;AAFC,SAdL;AAkBL,cAAM;AACJ,kBAAM,MADF;AAEJ,mBAAO;AAFH,SAlBD;AAsBL,cAAM;AACJ,kBAAM,MADF;AAEJ,mBAAO;AAFH,SAtBD;AA0BL,eAAO;AACL,kBAAM,OADD;AAEL,mBAAO;AAFF,SA1BF;AA8BL,cAAM;AACJ,kBAAM,MADF;AAEJ,mBAAO;AAFH,SA9BD;AAkCL,yBAAiB;AACf,kBAAM,MADS;AAEf,mBAAO;AAFQ,SAlCZ;AAsCL,2BAAmB;AACjB,kBAAM,MADW;AAEjB,mBAAO;AAFU;AAtCd,KADI;AA6CX,aAAS;AACP,mBADO,yBACI;AACT,gBAAI,CAAC,KAAK,IAAL,CAAU,OAAX,IAAsB,CAAC,KAAK,IAAL,CAAU,QAArC,EAA+C;AAC7C,qBAAK,KAAL,CAAW,OAAX;AACD;AACF;AALM;AA7CE,CAAb,E","file":"packages/button/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 4);\n","import { basic } from '../mixins/basic.ts';\nimport { NutComponentOptions } from '../definitions/index.ts';\n\nfunction mapKeys(\n source: Record<string, any>,\n target: Record<string, any>,\n map: Record<string, any>\n) {\n Object.keys(map).forEach((key) => {\n if (source[key]) {\n target[map[key]] = source[key];\n }\n });\n}\n\nfunction NutComponent<\n Data extends WechatMiniprogram.Component.DataOption,\n Props extends WechatMiniprogram.Component.PropertyOption,\n Methods extends WechatMiniprogram.Component.MethodOption\n>(NutOptions: NutComponentOptions<Data, Props, Methods>): void {\n const options: WechatMiniprogram.Component.Options<Data, Props, Methods> = {};\n\n mapKeys(NutOptions, options, {\n data: 'data',\n props: 'properties',\n mixins: 'behaviors',\n methods: 'methods',\n beforeCreate: 'created',\n created: 'attached',\n mounted: 'ready',\n destroyed: 'detached',\n classes: 'externalClasses',\n observers: 'observers'\n });\n\n // add default externalClasses\n options.externalClasses = options.externalClasses || [];\n options.externalClasses.push('custom-class');\n\n // add default behaviors\n options.behaviors = options.behaviors || [];\n options.behaviors.push(basic);\n\n // add relations\n const { relation } = NutOptions;\n if (relation) {\n options.relations = relation.relations;\n options.behaviors.push(relation.mixin);\n }\n \n // map field to form-field behavior\n if (NutOptions.field) {\n options.behaviors.push('wx://form-field');\n }\n\n // add default options\n options.options = {\n multipleSlots: true,\n addGlobalClass: true,\n };\n\n console.log(options)\n\n Component(options);\n}\n\n\nmodule.exports = { NutComponent };\n","export const basic = Behavior({\n methods: {\n $emit(\n name: string,\n detail?: Record<string, unknown>,\n options?: WechatMiniprogram.Component.TriggerEventOption\n ) {\n this.triggerEvent(name, detail, options);\n },\n \n set(data: Record<string, unknown>) {\n this.setData(data);\n \n return new Promise((resolve) => wx.nextTick(resolve));\n },\n },\n });\n ","import { NutComponent } from './../../common/component.ts'\r\n\r\nNutComponent({\r\n props: {\r\n color: String,\r\n shape: {\r\n type: String,\r\n value: 'round'\r\n },\r\n plain: {\r\n type: Boolean,\r\n value: false\r\n },\r\n loading: {\r\n type: Boolean,\r\n value: false\r\n },\r\n disabled: {\r\n type: Boolean,\r\n value: false\r\n },\r\n type: {\r\n type: String,\r\n value: 'default'\r\n },\r\n size: {\r\n type: String,\r\n value: 'normal'\r\n },\r\n block: {\r\n type: Boolean,\r\n value: false\r\n },\r\n icon: {\r\n type: String,\r\n value: ''\r\n },\r\n iconClassPrefix: {\r\n type: String,\r\n value: 'nut-icon'\r\n },\r\n iconFontClassName: {\r\n type: String,\r\n value: 'nutui-iconfont'\r\n }\r\n },\r\n\r\n methods: {\r\n handleClick() {\r\n if (!this.data.loading && !this.data.disabled) {\r\n this.$emit('click');\r\n }\r\n },\r\n },\r\n});\r\n"],"sourceRoot":""}
\ No newline at end of file
miniprogram_dev/components/packages/overlay/index.js
浏览文件 @
f718cd60
...
...
@@ -82,7 +82,7 @@ module.exports =
/******/
/******/
/******/
// Load entry module and return exports
/******/
return
__webpack_require__
(
__webpack_require__
.
s
=
1
2
);
/******/
return
__webpack_require__
(
__webpack_require__
.
s
=
1
3
);
/******/
})
/************************************************************************/
/******/
({
...
...
@@ -168,7 +168,7 @@ var basic = exports.basic = Behavior({
/***/
}),
/***/
1
2
:
/***/
1
3
:
/***/
(
function
(
module
,
exports
,
__webpack_require__
)
{
"
use strict
"
;
...
...
@@ -180,31 +180,23 @@ var _component = __webpack_require__(0);
props
:
{
show
:
{
type
:
Boolean
,
default
:
false
value
:
false
},
zIndex
:
{
type
:
[
Number
,
String
],
default
:
2000
value
:
2000
},
duration
:
{
type
:
[
Number
,
String
],
default
:
0.3
value
:
300
},
overlayClass
:
{
type
:
String
,
default
:
''
},
lockScroll
:
{
type
:
Boolean
,
default
:
false
},
overlayStyle
:
Object
,
closeOnClickOverlay
:
{
type
:
Boolean
,
default
:
true
}
overlayStyle
:
String
},
methods
:
{}
methods
:
{
onClick
:
function
onClick
()
{
this
.
$emit
(
'
click
'
);
}
}
});
/***/
})
...
...
miniprogram_dev/components/packages/overlay/index.js.map
浏览文件 @
f718cd60
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/common/component.ts","webpack:///./src/mixins/basic.ts","webpack:///./src/packages/overlay/index.ts"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAE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6BAAqB;AACnB,kBAAM,OADa;AAEnB,qBAAS;AAFU;AAtBhB,KADI;AA6BX,aAAS;AA7BE,CAAb,E","file":"packages/overlay/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","import { basic } from '../mixins/basic.ts';\nimport { NutComponentOptions } from '../definitions/index.ts';\n\nfunction mapKeys(\n source: Record<string, any>,\n target: Record<string, any>,\n map: Record<string, any>\n) {\n Object.keys(map).forEach((key) => {\n if (source[key]) {\n target[map[key]] = source[key];\n }\n });\n}\n\nfunction NutComponent<\n Data extends WechatMiniprogram.Component.DataOption,\n Props extends WechatMiniprogram.Component.PropertyOption,\n Methods extends WechatMiniprogram.Component.MethodOption\n>(NutOptions: NutComponentOptions<Data, Props, Methods>): void {\n const options: WechatMiniprogram.Component.Options<Data, Props, Methods> = {};\n\n mapKeys(NutOptions, options, {\n data: 'data',\n props: 'properties',\n mixins: 'behaviors',\n methods: 'methods',\n beforeCreate: 'created',\n created: 'attached',\n mounted: 'ready',\n destroyed: 'detached',\n classes: 'externalClasses',\n observers: 'observers'\n });\n\n // add default externalClasses\n options.externalClasses = options.externalClasses || [];\n options.externalClasses.push('custom-class');\n\n // add default behaviors\n options.behaviors = options.behaviors || [];\n options.behaviors.push(basic);\n\n // add relations\n const { relation } = NutOptions;\n if (relation) {\n options.relations = relation.relations;\n options.behaviors.push(relation.mixin);\n }\n \n // map field to form-field behavior\n if (NutOptions.field) {\n options.behaviors.push('wx://form-field');\n }\n\n // add default options\n options.options = {\n multipleSlots: true,\n addGlobalClass: true,\n };\n\n console.log(options)\n\n Component(options);\n}\n\n\nmodule.exports = { NutComponent };\n","export const basic = Behavior({\n methods: {\n $emit(\n name: string,\n detail?: Record<string, unknown>,\n options?: WechatMiniprogram.Component.TriggerEventOption\n ) {\n this.triggerEvent(name, detail, options);\n },\n \n set(data: Record<string, unknown>) {\n this.setData(data);\n \n return new Promise((resolve) => wx.nextTick(resolve));\n },\n },\n });\n ","import { NutComponent } from './../../common/component.ts'\r\n\r\nNutComponent({\r\n props: {\r\n show: {\r\n type: Boolean,\r\n default: false\r\n },\r\n zIndex: {\r\n type: [Number, String],\r\n default: 2000\r\n },\r\n duration: {\r\n type: [Number, String],\r\n default: 0.3\r\n },\r\n overlayClass: {\r\n type: String,\r\n default: ''\r\n },\r\n lockScroll: {\r\n type: Boolean,\r\n default: false\r\n },\r\n overlayStyle: Object,\r\n closeOnClickOverlay: {\r\n type: Boolean,\r\n default: true\r\n }\r\n },\r\n\r\n methods: {\r\n \r\n },\r\n});\r\n"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/common/component.ts","webpack:///./src/mixins/basic.ts","webpack:///./src/packages/overlay/index.ts"],"names":[],"mappings":";;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,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A,KAAlB;AAKC,YAAQ,GAAR,CAAY,OAAZ;AAED,cAAU,OAAV;AACD;AAGD,OAAO,OAAP,GAAiB,EAAE,0BAAF,EAAjB,C;;;;;;;;;;;ACnEO,IAAM,wBAAQ,SAAS;AAC1B,aAAS;AACP,aADO,iBAEL,IAFK,EAGL,MAHK,EAIL,OAJK,EAImD;AAExD,iBAAK,YAAL,CAAkB,IAAlB,EAAwB,MAAxB,EAAgC,OAAhC;AACD,SAPM;AASP,WATO,eASH,IATG,EAS0B;AAC/B,iBAAK,OAAL,CAAa,IAAb;AAEA,mBAAO,IAAI,OAAJ,CAAY,UAAC,OAAD;AAAA,uBAAa,GAAG,QAAH,CAAY,OAAZ,CAAb;AAAA,aAAZ,CAAP;AACD;AAbM;AADiB,CAAT,CAAd,C;;;;;;;;;;;;ACEP,6BAAa;AACX,WAAO;AACL,cAAM;AACJ,kBAAM,OADF;AAEJ,mBAAO;AAFH,SADD;AAKL,gBAAQ;AACN,kBAAM,CAAC,MAAD,EAAS,MAAT,CADA;AAEN,mBAAO;AAFD,SALH;AASL,kBAAU;AACR,kBAAM,CAAC,MAAD,EAAS,MAAT,CADE;AAER,mBAAO;AAFC,SATL;AAaL,sBAAc;AAbT,KADI;AAiBX,aAAS;AACP,eADO,qBACA;AACL,iBAAK,KAAL,CAAW,OAAX;AACD;AAHM;AAjBE,CAAb,E","file":"packages/overlay/index.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","import { basic } from '../mixins/basic.ts';\nimport { NutComponentOptions } from '../definitions/index.ts';\n\nfunction mapKeys(\n source: Record<string, any>,\n target: Record<string, any>,\n map: Record<string, any>\n) {\n Object.keys(map).forEach((key) => {\n if (source[key]) {\n target[map[key]] = source[key];\n }\n });\n}\n\nfunction NutComponent<\n Data extends WechatMiniprogram.Component.DataOption,\n Props extends WechatMiniprogram.Component.PropertyOption,\n Methods extends WechatMiniprogram.Component.MethodOption\n>(NutOptions: NutComponentOptions<Data, Props, Methods>): void {\n const options: WechatMiniprogram.Component.Options<Data, Props, Methods> = {};\n\n mapKeys(NutOptions, options, {\n data: 'data',\n props: 'properties',\n mixins: 'behaviors',\n methods: 'methods',\n beforeCreate: 'created',\n created: 'attached',\n mounted: 'ready',\n destroyed: 'detached',\n classes: 'externalClasses',\n observers: 'observers'\n });\n\n // add default externalClasses\n options.externalClasses = options.externalClasses || [];\n options.externalClasses.push('custom-class');\n\n // add default behaviors\n options.behaviors = options.behaviors || [];\n options.behaviors.push(basic);\n\n // add relations\n const { relation } = NutOptions;\n if (relation) {\n options.relations = relation.relations;\n options.behaviors.push(relation.mixin);\n }\n \n // map field to form-field behavior\n if (NutOptions.field) {\n options.behaviors.push('wx://form-field');\n }\n\n // add default options\n options.options = {\n multipleSlots: true,\n addGlobalClass: true,\n };\n\n console.log(options)\n\n Component(options);\n}\n\n\nmodule.exports = { NutComponent };\n","export const basic = Behavior({\n methods: {\n $emit(\n name: string,\n detail?: Record<string, unknown>,\n options?: WechatMiniprogram.Component.TriggerEventOption\n ) {\n this.triggerEvent(name, detail, options);\n },\n \n set(data: Record<string, unknown>) {\n this.setData(data);\n \n return new Promise((resolve) => wx.nextTick(resolve));\n },\n },\n });\n ","import { NutComponent } from './../../common/component.ts'\r\n\r\nNutComponent({\r\n props: {\r\n show: {\r\n type: Boolean,\r\n value: false\r\n },\r\n zIndex: {\r\n type: [Number, String],\r\n value: 2000\r\n },\r\n duration: {\r\n type: [Number, String],\r\n value: 300\r\n },\r\n overlayStyle: String,\r\n },\r\n\r\n methods: {\r\n onClick(){\r\n this.$emit('click');\r\n }\r\n },\r\n});\r\n"],"sourceRoot":""}
\ No newline at end of file
miniprogram_dev/components/packages/overlay/index.json
浏览文件 @
f718cd60
{
"component"
:
true
,
"usingComponents"
:
{}
"usingComponents"
:
{
"nut-transition"
:
"../transition/index"
}
}
\ No newline at end of file
miniprogram_dev/components/packages/overlay/index.wxml
浏览文件 @
f718cd60
<!-- <wxs src="./index.wxs" module="computed" /> -->
<!-- <Transition name="overlay-fade"> -->
<!-- <view :class="classes" @touchmove.stop="touchmove" @click="onClick" :style="style" v-show="visible">
<slot></slot>
</view> -->
<!-- </Transition> -->
<view ></view>
\ No newline at end of file
<nut-transition
name="fade"
show='{{ show }}'
custom-class="nut-overlay custom-class"
custom-style='z-index:{{zIndex}};{{overlayStyle}}'
bind:tap='onClick'
duration='{{duration}}'>
<slot></slot>
</nut-transition>
\ No newline at end of file
miniprogram_dev/components/packages/transition/index.js
浏览文件 @
f718cd60
...
...
@@ -82,7 +82,7 @@ module.exports =
/******/
/******/
/******/
// Load entry module and return exports
/******/
return
__webpack_require__
(
__webpack_require__
.
s
=
1
3
);
/******/
return
__webpack_require__
(
__webpack_require__
.
s
=
1
2
);
/******/
})
/************************************************************************/
/******/
({
...
...
@@ -168,7 +168,7 @@ var basic = exports.basic = Behavior({
/***/
}),
/***/
1
3
:
/***/
1
2
:
/***/
(
function
(
module
,
exports
,
__webpack_require__
)
{
"
use strict
"
;
...
...
miniprogram_dev/components/packages/transition/index.js.map
浏览文件 @
f718cd60
此差异已折叠。
点击以展开。
miniprogram_dev/components/packages/transition/index.wxml
浏览文件 @
f718cd60
<wxs src="./index.wxs" module="computed" />
<view
wx:if='{{ inited }}'
class="nut-transition
block
{{ classes }}"
class="nut-transition
custom-class
{{ classes }}"
style="{{ computed.styled({ currentDuration, display, customStyle }) }}">
<slot />
</view>
\ No newline at end of file
miniprogram_dev/package.json
浏览文件 @
f718cd60
...
...
@@ -3,4 +3,4 @@
"gulp-replace"
:
"^1.1.3"
,
"miniprogram-computed"
:
"^4.3.8"
}
}
\ No newline at end of file
}
miniprogram_dev/pages/basic/pages/overlay/index.js
浏览文件 @
f718cd60
Component
({
data
:{
show
:
false
,
contentShow
:
false
,
styleShow
:
false
,
timeShow
:
false
},
methods
:
{
onClickShow
()
{
this
.
trigger
(
true
);
},
onClickHide
(){
this
.
trigger
(
false
);
},
onClickContentShow
(){
this
.
setData
({
contentShow
:
true
});
},
onClickContentHide
(){
this
.
setData
({
contentShow
:
false
});
},
onClicStyleShow
(){
this
.
setData
({
styleShow
:
true
});
},
onClicStyleHide
(){
this
.
setData
({
styleShow
:
false
});
},
onClickTimeShow
(){
this
.
setData
({
timeShow
:
true
});
},
onClickTimeHide
(){
this
.
setData
({
timeShow
:
false
});
},
trigger
(
tag
){
this
.
setData
({
show
:
tag
});
}
}
})
miniprogram_dev/pages/basic/pages/overlay/index.wxml
浏览文件 @
f718cd60
<view class="demo">
<h2>基础用法</h2>
<nut-cell>
<nut-button type="primary" >显示遮罩层</nut-button>
<nut-overlay></nut-overlay>
<nut-button type="primary" bindtap='onClickShow' >显示遮罩层</nut-button>
</nut-cell>
<nut-overlay show='{{ show }}' bind:click="onClickHide"></nut-overlay>
<h2>遮罩样式</h2>
<nut-cell>
<nut-button type="primary" bindtap='onClicStyleShow' >遮罩样式</nut-button>
</nut-cell>
<nut-overlay show='{{ styleShow }}' bind:click="onClicStyleHide" overlay-style="background: rgba(0, 0, 0, .2)"></nut-overlay>
<h2>设置动画时间</h2>
<nut-cell>
<nut-button type="primary" bindtap='onClickTimeShow' >设置动画时间</nut-button>
</nut-cell>
<nut-overlay show='{{ timeShow }}' bind:click="onClickTimeHide" duration='1000'></nut-overlay>
<h2>嵌套内容</h2>
<nut-cell>
<nut-button type="primary" bindtap='onClickContentShow' >嵌入内容</nut-button>
</nut-cell>
<nut-overlay show='{{ contentShow }}' bind:click="onClickContentHide" custom-class='deno'>
<view class='block'></view>
</nut-overlay>
</view>
miniprogram_dev/pages/basic/pages/overlay/index.wxss
浏览文件 @
f718cd60
...
...
@@ -14,3 +14,14 @@
margin-right: 15px;
}
.block {
position: fixed;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
margin: -50px 0 0 -50px;
background-color: #1989fa;
}
\ No newline at end of file
miniprogram_dev/pages/basic/pages/transition/index.wxml
浏览文件 @
f718cd60
...
...
@@ -13,7 +13,7 @@
<nut-cell title="Custom" bindtap="onClickCustom"></nut-cell>
<nut-transition show='{{ amishow }}' name="{{ name }}"></nut-transition>
<nut-transition show='{{ amishow }}' name="{{ name }}"
custom-class="block"
></nut-transition>
<nut-transition
show="{{ showCustom }}"
...
...
src/packages/button/index.ts
浏览文件 @
f718cd60
...
...
@@ -47,8 +47,8 @@ NutComponent({
methods
:
{
handleClick
()
{
if
(
!
this
.
props
.
loading
&&
!
this
.
props
.
disabled
)
{
this
.
$emit
(
'
click
'
,
event
);
if
(
!
this
.
data
.
loading
&&
!
this
.
data
.
disabled
)
{
this
.
$emit
(
'
click
'
);
}
},
},
...
...
src/packages/overlay/index.json
浏览文件 @
f718cd60
{
"component"
:
true
,
"usingComponents"
:
{}
"usingComponents"
:
{
"nut-transition"
:
"../transition/index"
}
}
\ No newline at end of file
src/packages/overlay/index.ts
浏览文件 @
f718cd60
...
...
@@ -4,32 +4,22 @@ NutComponent({
props
:
{
show
:
{
type
:
Boolean
,
default
:
false
value
:
false
},
zIndex
:
{
type
:
[
Number
,
String
],
default
:
2000
value
:
2000
},
duration
:
{
type
:
[
Number
,
String
],
default
:
0.3
value
:
300
},
overlayClass
:
{
type
:
String
,
default
:
''
},
lockScroll
:
{
type
:
Boolean
,
default
:
false
},
overlayStyle
:
Object
,
closeOnClickOverlay
:
{
type
:
Boolean
,
default
:
true
}
overlayStyle
:
String
,
},
methods
:
{
onClick
(){
this
.
$emit
(
'
click
'
);
}
},
});
src/packages/overlay/index.wxml
浏览文件 @
f718cd60
<!-- <wxs src="./index.wxs" module="computed" /> -->
<!-- <Transition name="overlay-fade"> -->
<!-- <view :class="classes" @touchmove.stop="touchmove" @click="onClick" :style="style" v-show="visible">
<slot></slot>
</view> -->
<!-- </Transition> -->
<view ></view>
\ No newline at end of file
<nut-transition
name="fade"
show='{{ show }}'
custom-class="nut-overlay custom-class"
custom-style='z-index:{{zIndex}};{{overlayStyle}}'
bind:tap='onClick'
duration='{{duration}}'>
<slot></slot>
</nut-transition>
\ No newline at end of file
src/packages/transition/index.wxml
浏览文件 @
f718cd60
<wxs src="./index.wxs" module="computed" />
<view
wx:if='{{ inited }}'
class="nut-transition
block
{{ classes }}"
class="nut-transition
custom-class
{{ classes }}"
style="{{ computed.styled({ currentDuration, display, customStyle }) }}">
<slot />
</view>
\ No newline at end of file
tools/demo/pages/basic/pages/overlay/index.js
浏览文件 @
f718cd60
Component
({
data
:{
show
:
false
,
contentShow
:
false
,
styleShow
:
false
,
timeShow
:
false
},
methods
:
{
onClickShow
()
{
this
.
trigger
(
true
);
},
onClickHide
(){
this
.
trigger
(
false
);
},
onClickContentShow
(){
this
.
setData
({
contentShow
:
true
});
},
onClickContentHide
(){
this
.
setData
({
contentShow
:
false
});
},
onClicStyleShow
(){
this
.
setData
({
styleShow
:
true
});
},
onClicStyleHide
(){
this
.
setData
({
styleShow
:
false
});
},
onClickTimeShow
(){
this
.
setData
({
timeShow
:
true
});
},
onClickTimeHide
(){
this
.
setData
({
timeShow
:
false
});
},
trigger
(
tag
){
this
.
setData
({
show
:
tag
});
}
}
})
tools/demo/pages/basic/pages/overlay/index.wxml
浏览文件 @
f718cd60
<view class="demo">
<h2>基础用法</h2>
<nut-cell>
<nut-button type="primary" >显示遮罩层</nut-button>
<nut-overlay></nut-overlay>
<nut-button type="primary" bindtap='onClickShow' >显示遮罩层</nut-button>
</nut-cell>
<nut-overlay show='{{ show }}' bind:click="onClickHide"></nut-overlay>
<h2>遮罩样式</h2>
<nut-cell>
<nut-button type="primary" bindtap='onClicStyleShow' >遮罩样式</nut-button>
</nut-cell>
<nut-overlay show='{{ styleShow }}' bind:click="onClicStyleHide" overlay-style="background: rgba(0, 0, 0, .2)"></nut-overlay>
<h2>设置动画时间</h2>
<nut-cell>
<nut-button type="primary" bindtap='onClickTimeShow' >设置动画时间</nut-button>
</nut-cell>
<nut-overlay show='{{ timeShow }}' bind:click="onClickTimeHide" duration='1000'></nut-overlay>
<h2>嵌套内容</h2>
<nut-cell>
<nut-button type="primary" bindtap='onClickContentShow' >嵌入内容</nut-button>
</nut-cell>
<nut-overlay show='{{ contentShow }}' bind:click="onClickContentHide" custom-class='deno'>
<view class='block'></view>
</nut-overlay>
</view>
tools/demo/pages/basic/pages/overlay/index.wxss
浏览文件 @
f718cd60
...
...
@@ -14,3 +14,14 @@
margin-right: 15px;
}
.block {
position: fixed;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
margin: -50px 0 0 -50px;
background-color: #1989fa;
}
\ No newline at end of file
tools/demo/pages/basic/pages/transition/index.wxml
浏览文件 @
f718cd60
...
...
@@ -13,7 +13,7 @@
<nut-cell title="Custom" bindtap="onClickCustom"></nut-cell>
<nut-transition show='{{ amishow }}' name="{{ name }}"></nut-transition>
<nut-transition show='{{ amishow }}' name="{{ name }}"
custom-class="block"
></nut-transition>
<nut-transition
show="{{ showCustom }}"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录