Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
erosXXX
uni-app
提交
93d5750d
U
uni-app
项目概览
erosXXX
/
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,发现更多精彩内容 >>
提交
93d5750d
编写于
2月 03, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
91eaddeb
c54df5ac
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
49 addition
and
13 deletion
+49
-13
docs/collocation/manifest.md
docs/collocation/manifest.md
+1
-0
docs/component/image.md
docs/component/image.md
+1
-0
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+5
-4
packages/vue-cli-plugin-hbuilderx/packages/webpack-uni-nvue-loader/lib/template.js
...builderx/packages/webpack-uni-nvue-loader/lib/template.js
+2
-1
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+5
-3
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
+1
-1
src/core/helpers/protocol/media/choose-file.js
src/core/helpers/protocol/media/choose-file.js
+4
-1
src/core/helpers/protocol/media/choose-image.js
src/core/helpers/protocol/media/choose-image.js
+1
-1
src/core/helpers/protocol/media/choose-video.js
src/core/helpers/protocol/media/choose-video.js
+1
-1
src/core/view/components/image/index.vue
src/core/view/components/image/index.vue
+5
-0
src/core/view/mixins/touchtrack.js
src/core/view/mixins/touchtrack.js
+23
-1
未找到文件。
docs/collocation/manifest.md
浏览文件 @
93d5750d
...
...
@@ -59,6 +59,7 @@ uni 统计配置项
|distribute|Object|App 发布信息,
[
详见
](
/collocation/manifest?id=distribute
)
||
|usingComponents|Boolean|是否启用自定义组件模式,默认为false,
[
编译模式区别详情
](
https://ask.dcloud.net.cn/article/35843
)
|1.9.0+|
|nvueCompiler|String|切换 nvue 编译模式,可选值,
`weex`
:老编译模式,
`uni-app`
: 新编译模式,默认为
`weex`
。
[
编译模式区别详情
](
http://ask.dcloud.net.cn/article/36074
)
|2.0.3+|
|nvueStyleCompiler|String|切换 nvue 样式编译模式,可选值,
`weex`
:老编译模式,
`uni-app`
: 新编译模式,默认为
`weex`
。
[
编译模式区别详情
](
https://ask.dcloud.net.cn/article/38751
)
|3.1.1+|
|renderer|String|可不加载基于 webview 的运行框架,减少包体积、提升启动速度。可选值
`native`
| App-nvue 2.2.0+|
|compilerVersion|Number|编译器版本,可选值:2、3 默认 2
[
详见
](
https://ask.dcloud.net.cn/article/36599
)
|HBuilderX alpha 2.4.4+或HBuilderX 2.5.0+|
|nvueLaunchMode|Number|Nvue 首页启动模式,在 compilerVersion 值为 3 时生效,可选值:normal、fast 默认 normal(HBuilderX alpha 2.4.4-2.4.9 固定为 fast)
[
详见
](
https://ask.dcloud.net.cn/article/36749
)
|2.5.0+|
...
...
docs/component/image.md
浏览文件 @
93d5750d
...
...
@@ -10,6 +10,7 @@
|fade-show|Boolean|true|图片显示动画效果|仅App-nvue 2.3.4+ Android有效|
|webp|boolean|false|默认不解析 webP 格式,只支持网络资源|微信小程序2.9.0|
|show-menu-by-longpress|boolean|false|开启长按图片显示识别小程序码菜单|微信小程序2.7.0|
|draggable|boolean|true|鼠标长按是否能拖动图片|仅 H5 平台 3.1.1+ 有效|
|@error|HandleEvent||当错误发生时,发布到 AppService 的事件名,事件对象event.detail = {errMsg: 'something wrong'}||
|@load|HandleEvent||当图片载入完毕时,发布到 AppService 的事件名,事件对象event.detail = {height:'图片高度px', width:'图片宽度px'}|
|
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
93d5750d
...
...
@@ -2990,6 +2990,7 @@ function createComponentInstance(vnode, parent, suspense) {
return
instance
;
}
let
currentInstance
=
null
;
const
getCurrentInstance
=
()
=>
currentInstance
||
currentRenderingInstance
;
const
setCurrentInstance
=
(
instance
)
=>
{
currentInstance
=
instance
;
};
...
...
@@ -3247,7 +3248,7 @@ function defineEmit() {
}
// Core API ------------------------------------------------------------------
const
version
=
"
3.0.
4
"
;
const
version
=
"
3.0.
5
"
;
// import deepCopy from './deepCopy'
/**
...
...
@@ -3661,7 +3662,7 @@ function createVueApp(rootComponent, rootProps = null) {
}
function
applyOptions$1
(
options
,
instance
,
publicThis
)
{
Object
.
keys
(
options
).
forEach
(
name
=>
{
Object
.
keys
(
options
).
forEach
(
(
name
)
=>
{
if
(
name
.
indexOf
(
'
on
'
)
===
0
)
{
const
hook
=
options
[
name
];
if
(
isFunction
(
hook
))
{
...
...
@@ -3737,7 +3738,7 @@ var plugin = {
createMiniProgramApp
(
instance
);
return
instance
;
};
}
}
,
};
// @ts-ignore
...
...
@@ -3773,4 +3774,4 @@ function createApp(rootComponent, rootProps = null) {
return
createVueApp
(
rootComponent
,
rootProps
).
use
(
plugin
);
}
export
{
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createApp
,
createHook$1
as
createHook
,
createVueApp
,
customRef
,
defineComponent
,
defineEmit
,
defineProps
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
nextTick
,
onActivated
,
onAddToFavorites
,
onBackPress
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onError
,
onErrorCaptured
,
onHide
,
onLaunch
,
onLoad
,
onMounted
,
onNavigationBarButtonTap
,
onNavigationBarSearchInputChanged
,
onNavigationBarSearchInputClicked
,
onNavigationBarSearchInputConfirmed
,
onNavigationBarSearchInputFocusChanged
,
onPageNotFound
,
onPageScroll
,
onPullDownRefresh
,
onReachBottom
,
onReady
,
onRenderTracked
,
onRenderTriggered
,
onResize
,
onShareAppMessage
,
onShareTimeline
,
onShow
,
onTabItemTap
,
onThemeChange
,
onUnhandledRejection
,
onUnload
,
onUnmounted
,
onUpdated
,
provide
,
reactive
,
readonly
,
ref
,
resolveDirective
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
version
,
warn
,
watch
,
watchEffect
,
withDirectives
};
export
{
callWithAsyncErrorHandling
,
callWithErrorHandling
,
computed$1
as
computed
,
createApp
,
createHook$1
as
createHook
,
createVueApp
,
customRef
,
defineComponent
,
defineEmit
,
defineProps
,
getCurrentInstance
,
inject
,
injectHook
,
isInSSRComponentSetup
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
logError
,
markRaw
,
nextTick
,
onActivated
,
onAddToFavorites
,
onBackPress
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onError
,
onErrorCaptured
,
onHide
,
onLaunch
,
onLoad
,
onMounted
,
onNavigationBarButtonTap
,
onNavigationBarSearchInputChanged
,
onNavigationBarSearchInputClicked
,
onNavigationBarSearchInputConfirmed
,
onNavigationBarSearchInputFocusChanged
,
onPageNotFound
,
onPageScroll
,
onPullDownRefresh
,
onReachBottom
,
onReady
,
onRenderTracked
,
onRenderTriggered
,
onResize
,
onShareAppMessage
,
onShareTimeline
,
onShow
,
onTabItemTap
,
onThemeChange
,
onUnhandledRejection
,
onUnload
,
onUnmounted
,
onUpdated
,
provide
,
reactive
,
readonly
,
ref
,
resolveDirective
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
toRaw
,
toRef
,
toRefs
,
triggerRef
,
unref
,
version
,
warn
,
watch
,
watchEffect
,
withDirectives
};
packages/vue-cli-plugin-hbuilderx/packages/webpack-uni-nvue-loader/lib/template.js
浏览文件 @
93d5750d
...
...
@@ -69,6 +69,7 @@ module.exports = function (content, map) {
}
Object
.
assign
(
appJson
.
globalStyle
,
appJson
.
globalStyle
[
'
app-plus
'
]
||
{})
pageJson
.
style
=
pageJson
.
style
||
{}
Object
.
assign
(
pageJson
.
style
,
pageJson
.
style
[
'
app-plus
'
]
||
{})
const
pageJsonStyle
=
Object
.
assign
(
appJson
.
globalStyle
,
pageJson
.
style
)
if
(
pageJsonStyle
.
disableScroll
===
true
)
{
...
...
@@ -78,4 +79,4 @@ module.exports = function (content, map) {
this
.
callback
(
null
,
`<scroll-view :scroll-y="true" :show-scrollbar="
${
pageJsonStyle
.
scrollIndicator
===
'
none
'
?
'
false
'
:
'
true
'
}
" :enableBackToTop="true" bubble="true" style="flex-direction:column">
${
content
}
</scroll-view>`
,
map
)
}
}
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
93d5750d
...
...
@@ -83,7 +83,7 @@ if (
const
defaultOutputDir
=
'
../../../../dist/
'
+
(
process
.
env
.
NODE_ENV
===
'
production
'
?
'
build
'
:
'
dev
'
)
+
'
/
'
+
(
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
)
process
.
env
.
UNI_OUTPUT_DEFAULT_DIR
=
path
.
resolve
(
__dirname
,
defaultOutputDir
)
if
(
process
.
env
.
UNI_OUTPUT_DIR
&&
process
.
env
.
UNI_OUTPUT_DIR
.
indexOf
(
'
./
'
)
===
0
)
{
process
.
env
.
UNI_OUTPUT_DIR
=
path
.
resolve
(
process
.
cwd
(),
process
.
env
.
UNI_OUTPUT_DIR
)
...
...
@@ -243,8 +243,10 @@ if (isNVueCompiler) {
process
.
env
.
UNI_USING_NVUE_COMPILER
=
true
}
if
(
platformOptions
.
nvueStyleCompiler
!==
'
weex
'
)
{
if
(
platformOptions
.
nvueStyleCompiler
===
'
uni-app
'
)
{
process
.
env
.
UNI_USING_NVUE_STYLE_COMPILER
=
true
}
else
{
platformOptions
.
nvueStyleCompiler
=
'
weex
'
}
if
(
platformOptions
.
usingComponents
===
true
)
{
...
...
@@ -451,4 +453,4 @@ runByHBuilderX && console.log('正在编译中...')
module
.
exports
=
{
manifestPlatformOptions
:
platformOptions
}
}
packages/vue-cli-plugin-uni/packages/uni-cloud/dist/index.js
浏览文件 @
93d5750d
此差异已折叠。
点击以展开。
src/core/helpers/protocol/media/choose-file.js
浏览文件 @
93d5750d
...
...
@@ -32,6 +32,9 @@ export const chooseFile = {
},
extension
:
{
type
:
Array
,
default
:
[
''
]
default
:
[
''
],
validator
(
extension
,
params
)
{
if
(
extension
.
length
===
0
)
{
return
'
param extension should not be empty.
'
}
}
}
}
src/core/helpers/protocol/media/choose-image.js
浏览文件 @
93d5750d
...
...
@@ -35,7 +35,7 @@ export const chooseImage = {
type
:
Array
,
default
:
[
'
*
'
],
validator
(
extension
,
params
)
{
if
(
extension
.
length
===
0
)
params
.
extension
=
[
'
*
'
]
if
(
extension
.
length
===
0
)
{
return
'
param extension should not be empty.
'
}
}
}
}
src/core/helpers/protocol/media/choose-video.js
浏览文件 @
93d5750d
...
...
@@ -22,7 +22,7 @@ export const chooseVideo = {
type
:
Array
,
default
:
[
'
*
'
],
validator
(
extension
,
params
)
{
if
(
extension
.
length
===
0
)
params
.
extension
=
[
'
*
'
]
if
(
extension
.
length
===
0
)
{
return
'
param extension should not be empty.
'
}
}
}
}
src/core/view/components/image/index.vue
浏览文件 @
93d5750d
...
...
@@ -7,6 +7,7 @@
<img
v-if=
"contentPath"
:src=
"contentPath"
:draggable=
"draggable"
>
<v-uni-resize-sensor
v-if=
"mode === 'widthFix' || mode === 'heightFix'"
...
...
@@ -39,6 +40,10 @@ export default {
lazyLoad
:
{
type
:
[
Boolean
,
String
],
default
:
false
},
draggable
:
{
type
:
Boolean
,
default
:
true
}
},
data
()
{
...
...
src/core/view/mixins/touchtrack.js
浏览文件 @
93d5750d
...
...
@@ -8,6 +8,7 @@ const addListenerToElement = function (element, type, callback, capture) {
}
}
},
{
capture
,
passive
:
false
})
}
...
...
@@ -48,6 +49,7 @@ export default {
}
let
$eventOld
=
null
let
hasClickListenerOld
let
hasTouchStart
let
hasMouseDown
addListenerToElement
(
element
,
'
touchstart
'
,
function
(
$event
)
{
...
...
@@ -77,8 +79,20 @@ export default {
return
res
}
})
// 阻止点击事件传播,处理拖拽和点击冲突,鼠标移动则添加监听,停止移动则移除监听
const
clickEventListener
=
this
.
__clickEventListener
=
function
(
$event
)
{
$event
.
preventDefault
()
$event
.
stopPropagation
()
}
const
mouseMoveEventListener
=
this
.
__mouseMoveEventListener
=
function
(
$event
)
{
if
(
!
hasTouchStart
&&
hasMouseDown
&&
$eventOld
)
{
// 存在鼠标移动,则在 document 上添加点击监听(好处是不用管具体使用拖拽的是什么元素)
if
(
!
hasClickListenerOld
&&
(
Math
.
abs
(
x1
-
x0
)
>
2
||
Math
.
abs
(
y1
-
y0
)
>
2
))
{
document
.
addEventListener
(
'
click
'
,
clickEventListener
,
true
)
hasClickListenerOld
=
true
}
// TODO target currentTarget touches changedTouches
const
res
=
fn
(
$event
,
'
move
'
,
$event
.
pageX
,
$event
.
pageY
)
x1
=
$event
.
pageX
...
...
@@ -94,15 +108,23 @@ export default {
return
fn
(
$event
,
'
end
'
,
$event
.
changedTouches
[
0
].
pageX
,
$event
.
changedTouches
[
0
].
pageY
)
}
})
const
mouseUpEventListener
=
this
.
__mouseUpEventListener
=
function
(
$event
)
{
const
mouseUpEventListener
=
this
.
__mouseUpEventListener
=
(
$event
)
=>
{
hasMouseDown
=
false
if
(
!
hasTouchStart
&&
$eventOld
)
{
// 鼠标抬起,存在监听,则 mouseup 结束后移除就监听事件
if
(
hasClickListenerOld
)
{
setTimeout
(()
=>
{
document
.
removeEventListener
(
'
click
'
,
this
.
__clickEventListener
,
true
)
hasClickListenerOld
=
false
},
0
)
}
// TODO target currentTarget touches changedTouches
$eventOld
=
null
return
fn
(
$event
,
'
end
'
,
$event
.
pageX
,
$event
.
pageY
)
}
}
document
.
addEventListener
(
'
mouseup
'
,
mouseUpEventListener
)
addListenerToElement
(
element
,
'
touchcancel
'
,
function
(
$event
)
{
if
(
$eventOld
)
{
hasTouchStart
=
false
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录