Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
一把秋刀鱼
uni-app
提交
7c48ee1f
U
uni-app
项目概览
一把秋刀鱼
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
4
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,发现更多精彩内容 >>
提交
7c48ee1f
编写于
12月 28, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(v3): renderjs
上级
43d111b9
变更
11
展开全部
隐藏空白更改
内联
并排
Showing
11 changed file
with
72 addition
and
22 deletion
+72
-22
packages/uni-app-plus/dist/view.css
packages/uni-app-plus/dist/view.css
+1
-1
packages/uni-app-plus/dist/view.umd.min.js
packages/uni-app-plus/dist/view.umd.min.js
+2
-2
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+6
-0
packages/uni-template-compiler/lib/index.js
packages/uni-template-compiler/lib/index.js
+8
-5
packages/vue-cli-plugin-uni/lib/app-plus/index.js
packages/vue-cli-plugin-uni/lib/app-plus/index.js
+8
-7
packages/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/dist/parseCustomBlocks.js
...s/@vue/component-compiler-utils/dist/parseCustomBlocks.js
+3
-2
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
+17
-1
packages/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js
...ni/packages/vue-loader/lib/runtime/componentNormalizer.js
+9
-1
packages/vue-cli-plugin-uni/packages/vue-loader/lib/select.js
...ages/vue-cli-plugin-uni/packages/vue-loader/lib/select.js
+13
-0
src/platforms/app-plus/view/framework/plugins/data.js
src/platforms/app-plus/view/framework/plugins/data.js
+4
-2
未找到文件。
packages/uni-app-plus/dist/view.css
浏览文件 @
7c48ee1f
此差异已折叠。
点击以展开。
packages/uni-app-plus/dist/view.umd.min.js
浏览文件 @
7c48ee1f
此差异已折叠。
点击以展开。
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
7c48ee1f
此差异已折叠。
点击以展开。
packages/uni-mp-alipay/dist/index.js
浏览文件 @
7c48ee1f
...
...
@@ -1047,6 +1047,12 @@ function createSelectorQuery () {
return
this
};
}
if
(
!
query
.
in
)
{
query
.
in
=
function
()
{
return
this
};
}
return
query
}
...
...
packages/uni-template-compiler/lib/index.js
浏览文件 @
7c48ee1f
...
...
@@ -168,12 +168,15 @@ at ${resourcePath}.vue:1`)
}
const
filterTemplate
=
[]
options
.
mp
.
filterModules
.
forEach
(
name
=>
{
filterTemplate
.
push
(
options
.
mp
.
platform
.
createFilterTag
(
options
.
filterTagName
,
options
.
filterModules
[
name
]
const
filterModule
=
options
.
filterModules
[
name
]
if
(
filterModule
.
type
!==
'
renderjs
'
&&
filterModule
.
attrs
.
lang
!==
'
renderjs
'
)
{
filterTemplate
.
push
(
options
.
mp
.
platform
.
createFilterTag
(
options
.
filterTagName
,
options
.
filterModules
[
name
]
)
)
)
}
})
if
(
filterTemplate
.
length
)
{
...
...
packages/vue-cli-plugin-uni/lib/app-plus/index.js
浏览文件 @
7c48ee1f
...
...
@@ -36,7 +36,8 @@ function getProvides (isAppService) {
'
getRegExp
'
:
[
wxsPath
,
'
getRegExp
'
]
}
}
return
{
// app-view
return
{
// app-view
'
__f__
'
:
[
path
.
resolve
(
__dirname
,
'
../format-log.js
'
),
'
default
'
],
'
getDate
'
:
[
wxsPath
,
'
getDate
'
],
'
getRegExp
'
:
[
wxsPath
,
'
getRegExp
'
]
}
...
...
@@ -89,12 +90,12 @@ const v3 = {
'
../../packages/webpack-uni-app-loader/view/script
'
)
})
// view 层 renderjs
rules
.
push
({
resourceQuery
:
[
/lang=renderjs/
,
/blockType=renderjs/
],
use
:
[{
loader
:
path
.
resolve
(
__dirname
,
'
../../packages/webpack-uni-app-loader/view/renderjs
'
)
}]
})
//
rules.push({
//
resourceQuery: [/lang=renderjs/, /blockType=renderjs/],
//
use: [{
//
loader: path.resolve(__dirname, '../../packages/webpack-uni-app-loader/view/renderjs')
//
}]
//
})
}
scriptLoaders
.
push
({
loader
:
path
.
resolve
(
__dirname
,
...
...
packages/vue-cli-plugin-uni/packages/@vue/component-compiler-utils/dist/parseCustomBlocks.js
浏览文件 @
7c48ee1f
...
...
@@ -27,13 +27,14 @@ module.exports = function parseCustomBlocks(descriptor, options) {
return
true
}
if
(
// renderjs
options
.
isAppView
&&
block
.
attrs
.
module
&&
(
block
.
type
===
'
renderjs
'
||
block
.
attrs
.
lang
===
'
renderjs
'
)
)
{
return
true
descriptor
.
renderjs
=
block
modules
[
block
.
attrs
.
module
]
=
block
}
})
...
...
packages/vue-cli-plugin-uni/packages/vue-loader/lib/index.js
浏览文件 @
7c48ee1f
...
...
@@ -141,6 +141,20 @@ module.exports = function (source) {
)
}
let
renderjsImport
=
`var renderjs`
if
(
options
.
isAppView
&&
descriptor
.
renderjs
){
const
src
=
descriptor
.
renderjs
.
src
||
resourcePath
const
attrsQuery
=
attrsToQuery
(
descriptor
.
renderjs
.
attrs
,
'
js
'
)
const
query
=
`?vue&type=renderjs
${
attrsQuery
}${
inheritQuery
}
`
const
request
=
stringifyRequest
(
src
+
query
)
renderjsImport
=
(
`import renderjs from
${
request
}
\n`
+
`renderjs.__module = '
${
descriptor
.
renderjs
.
attrs
.
module
}
'\n`
+
`export * from
${
request
}
`
// support named exports
)
}
// styles
let
stylesCode
=
``
// fixed by xxxxxx 仅限 view 层
...
...
@@ -158,6 +172,7 @@ module.exports = function (source) {
// fixed by xxxxxx (injectStyles,auto components)
let
code
=
`
${
templateImport
}
${
renderjsImport
}
${
scriptImport
}
${
stylesCode
}
...
...
@@ -172,7 +187,8 @@ var component = normalizer(
${
hasScoped
?
JSON
.
stringify
(
id
)
:
`null`
}
,
${
isServer
?
JSON
.
stringify
(
hash
(
request
))
:
`null`
}
,
${
isShadow
?
`true`
:
`false`
}
,
components
components,
renderjs
)
`
.
trim
()
+
`\n`
...
...
packages/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js
浏览文件 @
7c48ee1f
...
...
@@ -13,7 +13,8 @@ export default function normalizeComponent (
scopeId
,
moduleIdentifier
,
/* server only */
shadowMode
,
/* vue-cli only */
components
// fixed by xxxxxx auto components
components
,
// fixed by xxxxxx auto components
renderjs
// fixed by xxxxxx renderjs
)
{
// Vue.extend constructor export interop
var
options
=
typeof
scriptExports
===
'
function
'
...
...
@@ -24,6 +25,13 @@ export default function normalizeComponent (
if
(
components
)
{
options
.
components
=
Object
.
assign
(
components
,
options
.
components
||
{})
}
// fixed by xxxxxx renderjs
if
(
renderjs
)
{
(
renderjs
.
beforeCreate
||
(
renderjs
.
beforeCreate
=
[])).
unshift
(
function
()
{
this
[
renderjs
.
__module
]
=
this
});
(
options
.
mixins
||
(
options
.
mixins
=
[])).
push
(
renderjs
)
}
// render functions
if
(
render
)
{
...
...
packages/vue-cli-plugin-uni/packages/vue-loader/lib/select.js
浏览文件 @
7c48ee1f
...
...
@@ -30,6 +30,19 @@ module.exports = function selectBlock (
return
}
// renderjs
if
(
query
.
type
===
`renderjs`
)
{
if
(
appendExtension
)
{
loaderContext
.
resourcePath
+=
'
.js
'
}
loaderContext
.
callback
(
null
,
descriptor
.
renderjs
.
content
,
descriptor
.
renderjs
.
map
)
return
}
// styles
if
(
query
.
type
===
`style`
&&
query
.
index
!=
null
)
{
const
style
=
descriptor
.
styles
[
query
.
index
]
...
...
src/platforms/app-plus/view/framework/plugins/data.js
浏览文件 @
7c48ee1f
...
...
@@ -81,7 +81,7 @@ function updateView () {
)
}
window
.
addEventListener
(
'
resize
'
,
updateView
)
window
.
addEventListener
(
'
resize
'
,
updateView
)
window
.
addEventListener
(
'
updateview
'
,
updateView
)
function
vdSync
({
...
...
@@ -119,7 +119,9 @@ function getData (id, name) {
function
getChangeData
(
id
,
name
)
{
try
{
const
value
=
this
.
$r
[
id
][
name
]
this
.
$set
(
this
.
wxsProps
,
name
.
replace
(
'
change:
'
,
''
),
value
)
const
wxsPropName
=
name
.
replace
(
'
change:
'
,
''
)
this
[
wxsPropName
]
=
value
this
.
$set
(
this
.
wxsProps
,
wxsPropName
,
value
)
return
value
}
catch
(
e
)
{
console
.
error
(
this
.
$options
.
__file
+
`:[
${
this
.
_$id
}
]$r[
${
id
}
][
${
name
}
] is undefined`
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录