Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Velpro187
uni-app
提交
95bf60f7
U
uni-app
项目概览
Velpro187
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
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,发现更多精彩内容 >>
提交
95bf60f7
编写于
11月 04, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
b4167052
8f8aa2af
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
415 addition
and
326 deletion
+415
-326
packages/uni-cli-shared/lib/manifest.js
packages/uni-cli-shared/lib/manifest.js
+2
-3
packages/uni-cli-shared/lib/util.js
packages/uni-cli-shared/lib/util.js
+19
-0
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+290
-295
packages/vue-cli-plugin-hbuilderx/index.js
packages/vue-cli-plugin-hbuilderx/index.js
+1
-1
packages/vue-cli-plugin-uni/lib/check-update.js
packages/vue-cli-plugin-uni/lib/check-update.js
+53
-4
packages/vue-cli-plugin-uni/lib/configure-webpack.js
packages/vue-cli-plugin-uni/lib/configure-webpack.js
+19
-4
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+4
-4
src/core/view/components/rich-text/index.vue
src/core/view/components/rich-text/index.vue
+13
-1
src/core/view/components/rich-text/nodes-parser.js
src/core/view/components/rich-text/nodes-parser.js
+14
-8
src/core/view/components/swiper/index.vue
src/core/view/components/swiper/index.vue
+0
-1
src/platforms/mp-weixin/runtime/index.js
src/platforms/mp-weixin/runtime/index.js
+0
-5
未找到文件。
packages/uni-cli-shared/lib/manifest.js
浏览文件 @
95bf60f7
...
@@ -85,8 +85,7 @@ function getH5Options (manifestJson) {
...
@@ -85,8 +85,7 @@ function getH5Options (manifestJson) {
}
}
/* eslint-disable no-mixed-operators */
/* eslint-disable no-mixed-operators */
h5
.
template
=
h5
.
template
&&
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
h5
.
template
)
||
path
.
resolve
(
__dirname
,
h5
.
template
=
h5
.
template
&&
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
h5
.
template
)
||
path
.
resolve
(
require
(
'
./util
'
).
getCLIContext
(),
'
public/index.html
'
)
'
../../../../public/index.html
'
)
h5
.
devServer
=
h5
.
devServer
||
{}
h5
.
devServer
=
h5
.
devServer
||
{}
...
...
packages/uni-cli-shared/lib/util.js
浏览文件 @
95bf60f7
...
@@ -14,6 +14,24 @@ try {
...
@@ -14,6 +14,24 @@ try {
const
isInHBuilderX
=
!!
aboutPkg
const
isInHBuilderX
=
!!
aboutPkg
const
isInHBuilderXAlpha
=
!!
(
isInHBuilderX
&&
aboutPkg
.
alpha
)
const
isInHBuilderXAlpha
=
!!
(
isInHBuilderX
&&
aboutPkg
.
alpha
)
function
getCLIContext
()
{
var
context
=
path
.
resolve
(
__dirname
,
'
../../../../
'
)
// const isInHBuilderX = fs.existsSync(path.resolve(context, 'bin/uniapp-cli.js'))
if
(
isInHBuilderX
)
{
return
context
}
const
pnpmFind
=
__dirname
.
match
(
/.+
?[\/\\]
.pnpm
[\/\\]
/
)
if
(
pnpmFind
)
{
const
pnpm
=
pnpmFind
[
0
]
context
=
path
.
resolve
(
pnpm
,
'
../../
'
)
}
const
isInCLI
=
fs
.
existsSync
(
path
.
resolve
(
context
,
'
./src
'
))
if
(
isInCLI
)
{
return
context
}
return
process
.
cwd
()
}
function
removeExt
(
str
,
ext
)
{
function
removeExt
(
str
,
ext
)
{
if
(
ext
)
{
if
(
ext
)
{
const
reg
=
new
RegExp
(
ext
.
replace
(
/
\.
/
,
'
\\
.
'
)
+
'
$
'
)
const
reg
=
new
RegExp
(
ext
.
replace
(
/
\.
/
,
'
\\
.
'
)
+
'
$
'
)
...
@@ -105,6 +123,7 @@ const _hasOwnProperty = Object.prototype.hasOwnProperty
...
@@ -105,6 +123,7 @@ const _hasOwnProperty = Object.prototype.hasOwnProperty
module
.
exports
=
{
module
.
exports
=
{
isInHBuilderX
,
isInHBuilderX
,
isInHBuilderXAlpha
,
isInHBuilderXAlpha
,
getCLIContext
,
normalizeNodeModules
,
normalizeNodeModules
,
md5
,
md5
,
hasOwn
(
obj
,
key
)
{
hasOwn
(
obj
,
key
)
{
...
...
packages/uni-mp-weixin/dist/index.js
浏览文件 @
95bf60f7
...
@@ -794,11 +794,6 @@ const customize = cached((str) => {
...
@@ -794,11 +794,6 @@ const customize = cached((str) => {
});
});
function
initTriggerEvent
(
mpInstance
)
{
function
initTriggerEvent
(
mpInstance
)
{
{
if
(
!
wx
.
canIUse
||
!
wx
.
canIUse
(
'
nextTick
'
))
{
return
}
}
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
;
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
])
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
])
...
...
packages/vue-cli-plugin-hbuilderx/index.js
浏览文件 @
95bf60f7
...
@@ -2,7 +2,7 @@ const fs = require('fs')
...
@@ -2,7 +2,7 @@ const fs = require('fs')
const
path
=
require
(
'
path
'
)
const
path
=
require
(
'
path
'
)
const
uniI18n
=
require
(
'
@dcloudio/uni-cli-i18n
'
)
const
uniI18n
=
require
(
'
@dcloudio/uni-cli-i18n
'
)
process
.
env
.
UNI_CLI_CONTEXT
=
path
.
resolve
(
__dirname
,
'
../../../
'
)
process
.
env
.
UNI_CLI_CONTEXT
=
require
(
'
@dcloudio/uni-cli-shared/lib/util
'
).
getCLIContext
(
)
process
.
env
.
UNI_HBUILDERX_PLUGINS
=
process
.
env
.
UNI_HBUILDERX_PLUGINS
||
path
.
resolve
(
__dirname
,
'
../../../../
'
)
process
.
env
.
UNI_HBUILDERX_PLUGINS
=
process
.
env
.
UNI_HBUILDERX_PLUGINS
||
path
.
resolve
(
__dirname
,
'
../../../../
'
)
...
...
packages/vue-cli-plugin-uni/lib/check-update.js
浏览文件 @
95bf60f7
...
@@ -13,12 +13,14 @@ class Upate {
...
@@ -13,12 +13,14 @@ class Upate {
this
.
_isAlpha
=
false
this
.
_isAlpha
=
false
this
.
_uniId
=
''
this
.
_uniId
=
''
this
.
_appId
=
''
this
.
_appId
=
''
this
.
_wt
=
0
this
.
_lc
=
''
this
.
_lcin
=
[]
}
}
get
uniId
()
{
get
uniId
()
{
return
this
.
_uniId
return
this
.
_uniId
}
}
set
uniId
(
value
)
{
set
uniId
(
value
)
{
this
.
_uniId
=
value
this
.
_uniId
=
value
}
}
...
@@ -26,7 +28,6 @@ class Upate {
...
@@ -26,7 +28,6 @@ class Upate {
get
appId
()
{
get
appId
()
{
return
this
.
_appId
return
this
.
_appId
}
}
set
appId
(
value
)
{
set
appId
(
value
)
{
this
.
_appId
=
value
this
.
_appId
=
value
}
}
...
@@ -34,7 +35,6 @@ class Upate {
...
@@ -34,7 +35,6 @@ class Upate {
get
compilerVersion
()
{
get
compilerVersion
()
{
return
this
.
_compilerVersion
return
this
.
_compilerVersion
}
}
set
compilerVersion
(
value
)
{
set
compilerVersion
(
value
)
{
this
.
_compilerVersion
=
value
this
.
_compilerVersion
=
value
}
}
...
@@ -42,11 +42,31 @@ class Upate {
...
@@ -42,11 +42,31 @@ class Upate {
get
isAlpha
()
{
get
isAlpha
()
{
return
this
.
_isAlpha
return
this
.
_isAlpha
}
}
set
isAlpha
(
value
)
{
set
isAlpha
(
value
)
{
this
.
_isAlpha
=
value
this
.
_isAlpha
=
value
}
}
get
wt
()
{
return
this
.
_wt
}
set
wt
(
value
)
{
this
.
_wt
=
value
}
get
lc
()
{
return
this
.
_lc
}
set
lc
(
value
)
{
this
.
_lc
=
value
}
get
lcin
()
{
return
this
.
_lcin
}
set
lcin
(
value
)
{
this
.
_lcin
=
value
}
get
versionType
()
{
get
versionType
()
{
return
(
this
.
isAlpha
?
'
a
'
:
'
r
'
)
return
(
this
.
isAlpha
?
'
a
'
:
'
r
'
)
}
}
...
@@ -156,6 +176,9 @@ class Upate {
...
@@ -156,6 +176,9 @@ class Upate {
data
.
appid
=
this
.
uniId
data
.
appid
=
this
.
uniId
data
.
vtype
=
this
.
versionType
data
.
vtype
=
this
.
versionType
data
.
vcode
=
this
.
compilerVersion
data
.
vcode
=
this
.
compilerVersion
data
.
wt
=
this
.
_wt
data
.
lc
=
this
.
_lc
data
.
in
=
this
.
_lcin
delete
data
.
lastCheck
delete
data
.
lastCheck
...
@@ -234,6 +257,28 @@ Object.assign(Upate.prototype, {
...
@@ -234,6 +257,28 @@ Object.assign(Upate.prototype, {
DEFAULT_INTERVAL
:
1000
*
60
*
60
*
24
DEFAULT_INTERVAL
:
1000
*
60
*
60
*
24
})
})
function
getLc
()
{
let
result
=
[]
const
locale_dir
=
path
.
join
(
process
.
env
.
UNI_CLI_CONTEXT
,
'
src/locale
'
)
if
(
!
fs
.
existsSync
(
locale_dir
))
{
return
result
}
let
files
=
fs
.
readdirSync
(
locale_dir
)
for
(
let
i
=
files
.
length
-
1
;
i
>=
0
;
i
--
)
{
let
filePath
=
files
[
i
]
let
extName
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
'
.
'
)
+
1
).
toLowerCase
()
if
(
extName
!==
'
json
'
)
{
continue
}
if
(
files
[
i
].
indexOf
(
'
uni-app.
'
)
<
0
)
{
result
.
push
(
filePath
.
substring
(
0
,
filePath
.
lastIndexOf
(
'
.
'
)))
}
}
return
result
}
module
.
exports
=
async
function
checkUpdate
()
{
module
.
exports
=
async
function
checkUpdate
()
{
const
{
const
{
isInHBuilderX
,
isInHBuilderX
,
...
@@ -255,6 +300,10 @@ module.exports = async function checkUpdate () {
...
@@ -255,6 +300,10 @@ module.exports = async function checkUpdate () {
update
.
uniId
=
manifest
.
appid
update
.
uniId
=
manifest
.
appid
const
appIdKey
=
process
.
env
.
UNI_PLATFORM
.
includes
(
'
quickapp
'
)
?
'
package
'
:
'
appid
'
const
appIdKey
=
process
.
env
.
UNI_PLATFORM
.
includes
(
'
quickapp
'
)
?
'
package
'
:
'
appid
'
update
.
appId
=
manifest
[
process
.
env
.
UNI_PLATFORM
]
?
(
manifest
[
process
.
env
.
UNI_PLATFORM
][
appIdKey
]
||
''
)
:
''
update
.
appId
=
manifest
[
process
.
env
.
UNI_PLATFORM
]
?
(
manifest
[
process
.
env
.
UNI_PLATFORM
][
appIdKey
]
||
''
)
:
''
const
cf
=
manifest
[
'
mp-weixin
'
]
?
manifest
[
'
mp-weixin
'
][
'
cloudfunctionRoot
'
]
:
''
update
.
wt
=
(
cf
&&
cf
.
length
)
?
1
:
0
update
.
lc
=
manifest
[
'
locale
'
]
?
manifest
[
'
locale
'
]
:
''
update
.
lcin
=
getLc
().
join
(
'
,
'
)
update
.
check
()
update
.
check
()
}
catch
(
e
)
{
}
catch
(
e
)
{
}
}
...
...
packages/vue-cli-plugin-uni/lib/configure-webpack.js
浏览文件 @
95bf60f7
...
@@ -15,7 +15,7 @@ function resolve (dir) {
...
@@ -15,7 +15,7 @@ function resolve (dir) {
}
}
function
resolveModule
(
dir
)
{
function
resolveModule
(
dir
)
{
return
path
.
resolve
(
__dirname
,
'
../../..
'
,
dir
)
return
path
.
resolve
(
process
.
env
.
UNI_CLI_CONTEXT
,
'
./node_modules
'
,
dir
)
}
}
module
.
exports
=
function
configureWebpack
(
platformOptions
,
manifestPlatformOptions
,
vueOptions
,
api
)
{
module
.
exports
=
function
configureWebpack
(
platformOptions
,
manifestPlatformOptions
,
vueOptions
,
api
)
{
...
@@ -184,8 +184,9 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
...
@@ -184,8 +184,9 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
platformWebpackConfig
=
platformWebpackConfig
(
webpackConfig
,
vueOptions
,
api
)
platformWebpackConfig
=
platformWebpackConfig
(
webpackConfig
,
vueOptions
,
api
)
}
}
// 移除 node_modules 目录,避免受路径上的 node_modules 影响
// 移除 node_modules 目录,避免受路径上的 node_modules 影响
webpackConfig
.
resolve
.
modules
=
webpackConfig
.
resolve
.
modules
.
filter
(
module
=>
module
!==
if
(
require
(
'
@dcloudio/uni-cli-shared/lib/util
'
).
isInHBuilderX
)
{
'
node_modules
'
)
webpackConfig
.
resolve
.
modules
=
webpackConfig
.
resolve
.
modules
.
filter
(
module
=>
module
!==
'
node_modules
'
)
}
const
plugins
=
[]
const
plugins
=
[]
...
@@ -298,6 +299,17 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
...
@@ -298,6 +299,17 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
}
}
}
catch
(
e
)
{}
}
catch
(
e
)
{}
const
resolveLoaderAlias
=
{}
const
modules
=
[
'
@vue/cli-plugin-babel
'
,
'
@vue/cli-service
'
]
modules
.
forEach
(
m
=>
{
const
{
dependencies
}
=
require
(
`
${
m
}
/package.json`
)
Object
.
keys
(
dependencies
).
forEach
(
key
=>
{
if
(
/-loader$/
.
test
(
key
))
{
resolveLoaderAlias
[
key
]
=
require
.
resolve
(
key
)
}
})
})
return
merge
({
return
merge
({
devtool
:
false
,
devtool
:
false
,
resolve
:
{
resolve
:
{
...
@@ -325,6 +337,9 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
...
@@ -325,6 +337,9 @@ module.exports = function configureWebpack (platformOptions, manifestPlatformOpt
noParse
:
/^
(
vue|vue-router|vuex|vuex-router-sync
)
$/
,
noParse
:
/^
(
vue|vue-router|vuex|vuex-router-sync
)
$/
,
rules
rules
},
},
resolveLoader
:
{
alias
:
resolveLoaderAlias
},
plugins
,
plugins
,
performance
:
{
performance
:
{
assetFilter
(
assetFilename
)
{
assetFilter
(
assetFilename
)
{
...
...
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
95bf60f7
...
@@ -107,11 +107,13 @@ if (process.env.UNI_CLOUD_SPACES) {
...
@@ -107,11 +107,13 @@ if (process.env.UNI_CLOUD_SPACES) {
}
}
// 初始化环境变量
// 初始化环境变量
const
defaultOutputDir
=
'
../../../../dist/
'
+
process
.
env
.
UNI_CLI_CONTEXT
=
require
(
'
@dcloudio/uni-cli-shared/lib/util
'
).
getCLIContext
()
const
defaultOutputDir
=
'
./dist/
'
+
(
process
.
env
.
NODE_ENV
===
'
production
'
?
'
build
'
:
'
dev
'
)
+
'
/
'
+
(
process
.
env
.
NODE_ENV
===
'
production
'
?
'
build
'
:
'
dev
'
)
+
'
/
'
+
(
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
)
(
process
.
env
.
UNI_SUB_PLATFORM
||
process
.
env
.
UNI_PLATFORM
)
process
.
env
.
UNI_OUTPUT_DEFAULT_DIR
=
path
.
resolve
(
__dirname
,
defaultOutputDir
)
process
.
env
.
UNI_OUTPUT_DEFAULT_DIR
=
path
.
resolve
(
process
.
env
.
UNI_CLI_CONTEXT
,
defaultOutputDir
)
if
(
process
.
env
.
UNI_OUTPUT_DIR
&&
process
.
env
.
UNI_OUTPUT_DIR
.
indexOf
(
'
./
'
)
===
0
)
{
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
)
process
.
env
.
UNI_OUTPUT_DIR
=
path
.
resolve
(
process
.
cwd
(),
process
.
env
.
UNI_OUTPUT_DIR
)
}
}
...
@@ -124,8 +126,6 @@ if (process.env.UNI_PLATFORM === 'app-plus') {
...
@@ -124,8 +126,6 @@ if (process.env.UNI_PLATFORM === 'app-plus') {
process
.
env
.
UNI_OUTPUT_TMP_DIR
=
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
'
../.tmp/app-plus
'
)
process
.
env
.
UNI_OUTPUT_TMP_DIR
=
path
.
resolve
(
process
.
env
.
UNI_OUTPUT_DIR
,
'
../.tmp/app-plus
'
)
}
}
process
.
env
.
UNI_CLI_CONTEXT
=
path
.
resolve
(
__dirname
,
'
../../../../
'
)
process
.
UNI_LIBRARIES
=
process
.
UNI_LIBRARIES
||
[
'
@dcloudio/uni-ui
'
]
process
.
UNI_LIBRARIES
=
process
.
UNI_LIBRARIES
||
[
'
@dcloudio/uni-ui
'
]
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
// 发行模式,不启用 cache
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
// 发行模式,不启用 cache
...
...
src/core/view/components/rich-text/index.vue
浏览文件 @
95bf60f7
...
@@ -32,13 +32,22 @@ export default {
...
@@ -32,13 +32,22 @@ export default {
},
},
methods
:
{
methods
:
{
_renderNodes
(
nodes
)
{
_renderNodes
(
nodes
)
{
let
scopeId
=
''
let
$vm
=
this
while
(
$vm
)
{
!
scopeId
&&
(
scopeId
=
$vm
.
$options
.
_scopeId
)
$vm
=
$vm
.
$parent
}
const
hasItemClick
=
!!
this
.
$listeners
.
itemclick
if
(
!
this
.
_isMounted
)
{
if
(
!
this
.
_isMounted
)
{
return
return
}
}
if
(
typeof
nodes
===
'
string
'
)
{
if
(
typeof
nodes
===
'
string
'
)
{
nodes
=
parseHtml
(
nodes
)
nodes
=
parseHtml
(
nodes
)
}
}
const
nodeList
=
parseNodes
(
nodes
,
document
.
createDocumentFragment
(),
this
)
const
nodeList
=
parseNodes
(
nodes
,
document
.
createDocumentFragment
(),
scopeId
,
hasItemClick
&&
this
.
triggerItemClick
)
nodeList
.
appendChild
(
this
.
$refs
.
sensor
.
$el
)
nodeList
.
appendChild
(
this
.
$refs
.
sensor
.
$el
)
const
content
=
this
.
$refs
.
content
const
content
=
this
.
$refs
.
content
content
.
innerHTML
=
''
content
.
innerHTML
=
''
...
@@ -46,6 +55,9 @@ export default {
...
@@ -46,6 +55,9 @@ export default {
},
},
_updateView
()
{
_updateView
()
{
window
.
dispatchEvent
(
new
CustomEvent
(
'
updateview
'
))
window
.
dispatchEvent
(
new
CustomEvent
(
'
updateview
'
))
},
triggerItemClick
(
e
,
detail
=
{})
{
this
.
$trigger
(
'
itemclick
'
,
e
,
detail
)
}
}
}
}
}
}
...
...
src/core/view/components/rich-text/nodes-parser.js
浏览文件 @
95bf60f7
...
@@ -102,13 +102,7 @@ function normlizeValue (tagName, name, value) {
...
@@ -102,13 +102,7 @@ function normlizeValue (tagName, name, value) {
return
value
return
value
}
}
export
default
function
parseNodes
(
nodes
,
parentNode
,
$vm
)
{
export
default
function
parseNodes
(
nodes
,
parentNode
,
scopeId
,
triggerItemClick
)
{
let
scopeId
=
''
while
(
$vm
)
{
!
scopeId
&&
(
scopeId
=
$vm
.
$options
.
_scopeId
)
$vm
=
$vm
.
$parent
}
nodes
.
forEach
(
function
(
node
)
{
nodes
.
forEach
(
function
(
node
)
{
if
(
!
isPlainObject
(
node
))
{
if
(
!
isPlainObject
(
node
))
{
return
return
...
@@ -146,9 +140,11 @@ export default function parseNodes (nodes, parentNode, $vm) {
...
@@ -146,9 +140,11 @@ export default function parseNodes (nodes, parentNode, $vm) {
})
})
}
}
processClickEvent
(
node
,
elem
,
triggerItemClick
)
const
children
=
node
.
children
const
children
=
node
.
children
if
(
Array
.
isArray
(
children
)
&&
children
.
length
)
{
if
(
Array
.
isArray
(
children
)
&&
children
.
length
)
{
parseNodes
(
node
.
children
,
elem
)
parseNodes
(
node
.
children
,
elem
,
scopeId
,
triggerItemClick
)
}
}
parentNode
.
appendChild
(
elem
)
parentNode
.
appendChild
(
elem
)
...
@@ -160,3 +156,13 @@ export default function parseNodes (nodes, parentNode, $vm) {
...
@@ -160,3 +156,13 @@ export default function parseNodes (nodes, parentNode, $vm) {
})
})
return
parentNode
return
parentNode
}
}
function
processClickEvent
(
node
,
elem
,
triggerItemClick
)
{
if
([
'
a
'
,
'
img
'
].
includes
(
node
.
name
)
&&
triggerItemClick
)
{
elem
.
setAttribute
(
'
onClick
'
,
'
return false;
'
)
elem
.
addEventListener
(
'
click
'
,
(
e
)
=>
{
triggerItemClick
(
e
,
{
node
})
e
.
stopPropagation
()
},
true
)
}
}
src/core/view/components/swiper/index.vue
浏览文件 @
95bf60f7
...
@@ -162,7 +162,6 @@ export default {
...
@@ -162,7 +162,6 @@ export default {
mounted
()
{
mounted
()
{
this
.
_currentCheck
()
this
.
_currentCheck
()
this
.
touchtrack
(
this
.
$refs
.
slidesWrapper
,
'
_handleContentTrack
'
,
true
)
this
.
touchtrack
(
this
.
$refs
.
slidesWrapper
,
'
_handleContentTrack
'
,
true
)
this
.
_resetLayout
()
this
.
$watch
(()
=>
{
this
.
$watch
(()
=>
{
return
this
.
autoplay
&&
!
this
.
userTracking
return
this
.
autoplay
&&
!
this
.
userTracking
},
this
.
_inintAutoplay
)
},
this
.
_inintAutoplay
)
...
...
src/platforms/mp-weixin/runtime/index.js
浏览文件 @
95bf60f7
...
@@ -13,11 +13,6 @@ const customize = cached((str) => {
...
@@ -13,11 +13,6 @@ const customize = cached((str) => {
})
})
function
initTriggerEvent
(
mpInstance
)
{
function
initTriggerEvent
(
mpInstance
)
{
if
(
__PLATFORM__
===
'
mp-weixin
'
||
__PLATFORM__
===
'
app-plus
'
)
{
if
(
!
wx
.
canIUse
||
!
wx
.
canIUse
(
'
nextTick
'
))
{
return
}
}
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
const
oldTriggerEvent
=
mpInstance
.
triggerEvent
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
mpInstance
.
triggerEvent
=
function
(
event
,
...
args
)
{
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
])
return
oldTriggerEvent
.
apply
(
mpInstance
,
[
customize
(
event
),
...
args
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录