Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_68066342
uni-app
提交
79caaa9c
U
uni-app
项目概览
m0_68066342
/
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,发现更多精彩内容 >>
提交
79caaa9c
编写于
1月 14, 2022
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: lint
上级
c25fc1ca
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
21 addition
and
16 deletion
+21
-16
packages/uni-cli-shared/lib/package.js
packages/uni-cli-shared/lib/package.js
+1
-1
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
...ni-template-compiler/__tests__/compiler-mp-weixin.spec.js
+12
-7
packages/vue-cli-plugin-uni/commands/build.js
packages/vue-cli-plugin-uni/commands/build.js
+1
-1
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
+6
-6
src/platforms/h5/view/components/ad/index.vue
src/platforms/h5/view/components/ad/index.vue
+1
-1
未找到文件。
packages/uni-cli-shared/lib/package.js
浏览文件 @
79caaa9c
...
@@ -35,7 +35,7 @@ module.exports = {
...
@@ -35,7 +35,7 @@ module.exports = {
if
(
scriptName
!==
name
)
{
if
(
scriptName
!==
name
)
{
const
define
=
uniAppOptions
.
scripts
[
scriptName
].
define
const
define
=
uniAppOptions
.
scripts
[
scriptName
].
define
Object
.
keys
(
define
).
forEach
(
name
=>
{
Object
.
keys
(
define
).
forEach
(
name
=>
{
if
(
typeof
scriptOptions
.
define
[
name
]
!==
"
undefined
"
)
{
if
(
typeof
scriptOptions
.
define
[
name
]
!==
'
undefined
'
)
{
delete
define
[
name
]
delete
define
[
name
]
}
else
{
}
else
{
define
[
name
]
=
false
define
[
name
]
=
false
...
...
packages/uni-template-compiler/__tests__/compiler-mp-weixin.spec.js
浏览文件 @
79caaa9c
...
@@ -56,33 +56,38 @@ describe('mp:compiler-mp-weixin', () => {
...
@@ -56,33 +56,38 @@ describe('mp:compiler-mp-weixin', () => {
it
(
'
generate string express with escape quote
'
,
()
=>
{
it
(
'
generate string express with escape quote
'
,
()
=>
{
assertCodegen
(
assertCodegen
(
`<view :data-text="text+'\\''"></view>`
,
'
<view :data-text="text+
\'\\\'\'
"></view>
'
,
'
<view data-text="{{$root.a0}}"></view>
'
,
'
<view data-text="{{$root.a0}}"></view>
'
,
`with(this){var a0=text+"'";$mp.data=Object.assign({},{$root:{a0:a0}})}`
'
with(this){var a0=text+"
\'
";$mp.data=Object.assign({},{$root:{a0:a0}})}
'
)
)
assertCodegen
(
assertCodegen
(
/* eslint-disable no-template-curly-in-string */
'
<view :data-text="`${text}
\'
`"></view>
'
,
'
<view :data-text="`${text}
\'
`"></view>
'
,
'
<view data-text="{{$root.a0}}"></view>
'
,
'
<view data-text="{{$root.a0}}"></view>
'
,
/* eslint-disable no-template-curly-in-string */
'
with(this){var a0=`${text}
\'
`;$mp.data=Object.assign({},{$root:{a0:a0}})}
'
'
with(this){var a0=`${text}
\'
`;$mp.data=Object.assign({},{$root:{a0:a0}})}
'
)
)
assertCodegen
(
assertCodegen
(
`<view>{{text+'\\''}}</view>`
,
'
<view>{{text+
\'\\\'\'
}}</view>
'
,
'
<view>{{$root.t0}}</view>
'
,
'
<view>{{$root.t0}}</view>
'
,
`with(this){var t0=text+"'";$mp.data=Object.assign({},{$root:{t0:t0}})}`
'
with(this){var t0=text+"
\'
";$mp.data=Object.assign({},{$root:{t0:t0}})}
'
)
)
assertCodegen
(
assertCodegen
(
/* eslint-disable no-template-curly-in-string */
'
<view>{{`${text}
\'
`}}</view>
'
,
'
<view>{{`${text}
\'
`}}</view>
'
,
'
<view>{{$root.t0}}</view>
'
,
'
<view>{{$root.t0}}</view>
'
,
/* eslint-disable no-template-curly-in-string */
'
with(this){var t0=`${text}
\'
`;$mp.data=Object.assign({},{$root:{t0:t0}})}
'
'
with(this){var t0=`${text}
\'
`;$mp.data=Object.assign({},{$root:{t0:t0}})}
'
)
)
assertCodegen
(
assertCodegen
(
/* eslint-disable no-template-curly-in-string */
'
<view>{{`${text}"`}}</view>
'
,
'
<view>{{`${text}"`}}</view>
'
,
`<view>{{text+'"'}}</view>`
'
<view>{{text+
\'
"
\'
}}</view>
'
)
)
assertCodegen
(
assertCodegen
(
`<view>{{text+"\\""}}</view>`
,
'
<view>{{text+"
\\
""}}</view>
'
,
'
<view>{{$root.t0}}</view>
'
,
'
<view>{{$root.t0}}</view>
'
,
`with(this){var t0=text+"\\"";$mp.data=Object.assign({},{$root:{t0:t0}})}`
'
with(this){var t0=text+"
\\
"";$mp.data=Object.assign({},{$root:{t0:t0}})}
'
)
)
})
})
...
...
packages/vue-cli-plugin-uni/commands/build.js
浏览文件 @
79caaa9c
packages/webpack-uni-mp-loader/lib/plugin/index-new.js
浏览文件 @
79caaa9c
...
@@ -77,21 +77,21 @@ function addMPPluginRequire (compilation) {
...
@@ -77,21 +77,21 @@ function addMPPluginRequire (compilation) {
if
(
needProcess
)
{
if
(
needProcess
)
{
const
modules
=
compilation
.
modules
const
modules
=
compilation
.
modules
const
orignalSource
=
compilation
.
assets
[
name
].
source
()
const
orignalSource
=
compilation
.
assets
[
name
].
source
()
const
globalEnv
=
process
.
env
.
UNI_PLATFORM
===
'
mp-alipay
'
?
'
my
'
:
'
wx
'
;
const
globalEnv
=
process
.
env
.
UNI_PLATFORM
===
'
mp-alipay
'
?
'
my
'
:
'
wx
'
const
filePath
=
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
name
))
const
filePath
=
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
name
))
const
uniModuleId
=
modules
.
find
(
module
=>
module
.
resource
&&
normalizePath
(
module
.
resource
)
===
filePath
).
id
const
uniModuleId
=
modules
.
find
(
module
=>
module
.
resource
&&
normalizePath
(
module
.
resource
)
===
filePath
).
id
const
newlineIndex
=
orignalSource
.
lastIndexOf
(
'
\n
'
)
const
newlineIndex
=
orignalSource
.
lastIndexOf
(
'
\n
'
)
const
source
=
const
source
=
orignalSource
.
substring
(
0
,
newlineIndex
)
orignalSource
.
substring
(
0
,
newlineIndex
)
+
+
`\nmodule.exports =
${
globalEnv
}
.__webpack_require_UNI_MP_PLUGIN__('
${
uniModuleId
}
');\n`
`\nmodule.exports =
${
globalEnv
}
.__webpack_require_UNI_MP_PLUGIN__('
${
uniModuleId
}
');\n`
+
+
orignalSource
.
substring
(
newlineIndex
+
1
)
orignalSource
.
substring
(
newlineIndex
+
1
)
compilation
.
assets
[
name
]
=
{
compilation
.
assets
[
name
]
=
{
size
()
{
size
()
{
return
Buffer
.
byteLength
(
source
,
'
utf8
'
)
return
Buffer
.
byteLength
(
source
,
'
utf8
'
)
},
},
source
()
{
source
()
{
return
source
return
source
}
}
}
}
...
...
src/platforms/h5/view/components/ad/index.vue
浏览文件 @
79caaa9c
...
@@ -545,7 +545,7 @@ export default {
...
@@ -545,7 +545,7 @@ export default {
}
}
},
},
_report
(
type
,
currentChannel
)
{
_report
(
type
,
currentChannel
)
{
le
t
reportData
=
{
cons
t
reportData
=
{
h
:
__uniConfig
.
compilerVersion
,
h
:
__uniConfig
.
compilerVersion
,
a
:
this
.
adpid
,
a
:
this
.
adpid
,
at
:
type
at
:
type
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录