Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
f28b6928
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f28b6928
编写于
2月 11, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: tree-shaking
上级
8a656509
变更
13
展开全部
隐藏空白更改
内联
并排
Showing
13 changed file
with
1631 addition
and
57 deletion
+1631
-57
packages/uni-components/dist/components.js
packages/uni-components/dist/components.js
+1597
-24
packages/uni-components/src/helpers/useNvueEvent.ts
packages/uni-components/src/helpers/useNvueEvent.ts
+2
-9
packages/uni-components/src/helpers/useUserAction.ts
packages/uni-components/src/helpers/useUserAction.ts
+1
-1
packages/uni-components/src/nvue/components.ts
packages/uni-components/src/nvue/components.ts
+2
-2
packages/uni-components/src/nvue/label/index.tsx
packages/uni-components/src/nvue/label/index.tsx
+1
-1
packages/uni-components/src/nvue/movable-view/index.tsx
packages/uni-components/src/nvue/movable-view/index.tsx
+1
-1
packages/uni-components/src/nvue/picker-view/index.tsx
packages/uni-components/src/nvue/picker-view/index.tsx
+1
-1
packages/uni-components/src/vue/scroll-view/index.tsx
packages/uni-components/src/vue/scroll-view/index.tsx
+1
-1
packages/uni-components/vite.config.ts
packages/uni-components/vite.config.ts
+14
-11
packages/uni-core/src/i18n/utils.ts
packages/uni-core/src/i18n/utils.ts
+1
-1
packages/uni-core/src/service/bridge/index.ts
packages/uni-core/src/service/bridge/index.ts
+3
-1
packages/uni-core/src/view/bridge/index.ts
packages/uni-core/src/view/bridge/index.ts
+6
-3
packages/uni-core/src/view/init/longPress.ts
packages/uni-core/src/view/init/longPress.ts
+1
-1
未找到文件。
packages/uni-components/dist/components.js
浏览文件 @
f28b6928
此差异已折叠。
点击以展开。
packages/uni-components/src/helpers/useNvueEvent.ts
浏览文件 @
f28b6928
import
{
cacheStringFunction
}
from
'
@dcloudio/uni-shared
'
import
{
Ref
,
SetupContext
,
EmitsOptions
}
from
'
vue
'
type
EventDetail
=
Record
<
string
,
any
>
...
...
@@ -31,15 +32,7 @@ function normalizeCustomEvent(
}
}
function
cached
(
fn
:
Function
)
{
const
cache
=
Object
.
create
(
null
)
return
function
cachedFn
(
str
:
string
)
{
const
hit
=
cache
[
str
]
return
hit
||
(
cache
[
str
]
=
fn
(
str
))
}
}
const
firstLetterToLowerCase
=
cached
((
str
:
string
)
=>
{
const
firstLetterToLowerCase
=
cacheStringFunction
((
str
:
string
)
=>
{
return
str
.
charAt
(
0
).
toLowerCase
()
+
str
.
slice
(
1
)
})
...
...
packages/uni-components/src/helpers/useUserAction.ts
浏览文件 @
f28b6928
...
...
@@ -6,7 +6,7 @@ export interface UserActionState {
userAction
:
boolean
}
const
passiveOptions
=
passive
(
true
)
const
passiveOptions
=
/*#__PURE__*/
passive
(
true
)
const
states
:
UserActionState
[]
=
[]
let
userInteract
:
number
=
0
let
inited
:
boolean
...
...
packages/uni-components/src/nvue/components.ts
浏览文件 @
f28b6928
...
...
@@ -5,8 +5,8 @@ import MovableArea from './movable-area'
import
MovableView
from
'
./movable-view
'
export
default
{
Navigator
,
/*
Label,
Label
,
Button
,
MovableArea
,
MovableView
*/
MovableView
,
}
packages/uni-components/src/nvue/label/index.tsx
浏览文件 @
f28b6928
...
...
@@ -8,7 +8,7 @@ type LabelTarget = HTMLElement & {
attr
:
{
dataUncType
:
string
}
}
export
default
defineComponent
({
export
default
/*#__PURE__*/
defineComponent
({
name
:
'
Label
'
,
props
,
styles
:
[],
...
...
packages/uni-components/src/nvue/movable-view/index.tsx
浏览文件 @
f28b6928
...
...
@@ -19,7 +19,7 @@ import {
CustomEventTrigger
,
EmitEvent
,
useCustomEvent
,
}
from
'
../../helpers/useN
v
ueEvent
'
}
from
'
../../helpers/useN
V
ueEvent
'
import
{
MovableViewContext
,
AddMovableViewContext
,
...
...
packages/uni-components/src/nvue/picker-view/index.tsx
浏览文件 @
f28b6928
...
...
@@ -12,7 +12,7 @@ import {
import
{
extend
}
from
'
@vue/shared
'
import
{
props
,
GetPickerViewColumn
}
from
'
../../components/picker-view
'
import
{
flatVNode
}
from
'
../../helpers/flatVNode
'
import
{
useCustomEvent
,
EmitEvent
}
from
'
../../helpers/useN
v
ueEvent
'
import
{
useCustomEvent
,
EmitEvent
}
from
'
../../helpers/useN
V
ueEvent
'
export
{
Props
,
GetPickerViewColumn
}
const
pickerViewProps
=
extend
({},
props
,
{
...
...
packages/uni-components/src/vue/scroll-view/index.tsx
浏览文件 @
f28b6928
...
...
@@ -34,7 +34,7 @@ interface State {
refreshState
:
RefreshState
}
const
passiveOptions
=
passive
(
true
)
const
passiveOptions
=
/*#__PURE__*/
passive
(
true
)
const
props
=
{
scrollX
:
{
...
...
packages/uni-components/vite.config.ts
浏览文件 @
f28b6928
...
...
@@ -11,7 +11,19 @@ export default defineConfig({
root
:
__dirname
,
define
:
{
global
:
'
window
'
,
__PLATFORM__
:
"
'app'
"
,
__DEV__
:
`(process.env.NODE_ENV !== 'production')`
,
__NODE_JS__
:
false
,
__APP_VIEW__
:
false
,
__VUE_OPTIONS_API__
:
true
,
__VUE_PROD_DEVTOOLS__
:
false
,
__UNI_FEATURE_WX__
:
true
,
__UNI_FEATURE_PROMISE__
:
false
,
__UNI_FEATURE_I18N_EN__
:
true
,
__UNI_FEATURE_I18N_ES__
:
true
,
__UNI_FEATURE_I18N_FR__
:
true
,
__UNI_FEATURE_I18N_ZH_HANS__
:
true
,
__UNI_FEATURE_I18N_ZH_HANT__
:
true
,
},
resolve
:
{
alias
:
[
...
...
@@ -26,21 +38,12 @@ export default defineConfig({
lib
:
{
name
:
'
components
'
,
entry
:
path
.
resolve
(
__dirname
,
'
src/nvue/components.ts
'
),
formats
:
[
'
iife
'
],
formats
:
[
'
es
'
],
},
rollupOptions
:
{
external
:
[
'
uni
'
,
'
vue
'
,
'
weex
'
,
'
@vue/shared
'
],
external
:
[
'
uni
'
,
'
vue
'
,
'
weex
'
,
'
@vue/shared
'
,
'
@dcloudio/uni-shared
'
],
output
:
{
banner
:
'
export function initComponents({uni,Vue,weex,plus,BroadcastChannel,UniViewJSBridge,VueShared}) {
'
,
footer
:
'
return components
\n
}
'
,
entryFileNames
:
'
components.js
'
,
globals
:
{
uni
:
'
uni
'
,
vue
:
'
Vue
'
,
weex
:
'
weex
'
,
'
@vue/shared
'
:
'
VueShared
'
,
},
},
},
},
...
...
packages/uni-core/src/i18n/utils.ts
浏览文件 @
f28b6928
import
{
once
}
from
'
@dcloudio/uni-shared
'
export
const
isEnableLocale
=
once
(
export
const
isEnableLocale
=
/*#__PURE__*/
once
(
()
=>
typeof
__uniConfig
!==
'
undefined
'
&&
__uniConfig
.
locales
&&
...
...
packages/uni-core/src/service/bridge/index.ts
浏览文件 @
f28b6928
...
...
@@ -5,7 +5,9 @@ import { invokeOnCallback } from './invokeOnCallback'
import
{
invokeViewMethod
,
invokeViewMethodKeepAlive
}
from
'
./invokeViewMethod
'
export
const
ServiceJSBridge
=
/*#__PURE__*/
extend
(
initBridge
(
'
view
'
/* view 指的是 service 层订阅的是 view 层事件 */
),
/*#__PURE__*/
initBridge
(
'
view
'
/* view 指的是 service 层订阅的是 view 层事件 */
),
{
invokeOnCallback
,
invokeViewMethod
,
...
...
packages/uni-core/src/view/bridge/index.ts
浏览文件 @
f28b6928
...
...
@@ -3,9 +3,12 @@ import { extend } from '@vue/shared'
import
{
initBridge
}
from
'
../../helpers/bridge
'
import
{
invokeServiceMethod
}
from
'
./invokeServiceMethod
'
export
const
ViewJSBridge
=
/*#__PURE__*/
extend
(
initBridge
(
'
service
'
),
{
invokeServiceMethod
,
})
export
const
ViewJSBridge
=
/*#__PURE__*/
extend
(
/*#__PURE__*/
initBridge
(
'
service
'
),
{
invokeServiceMethod
,
}
)
export
{
subscribeViewMethod
,
...
...
packages/uni-core/src/view/init/longPress.ts
浏览文件 @
f28b6928
...
...
@@ -3,7 +3,7 @@ import { passive } from '@dcloudio/uni-shared'
const
LONGPRESS_TIMEOUT
=
350
const
LONGPRESS_THRESHOLD
=
10
const
passiveOptions
=
passive
(
true
)
const
passiveOptions
=
/*#__PURE__*/
passive
(
true
)
let
longPressTimer
:
ReturnType
<
typeof
setTimeout
>
|
null
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录