Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
d529a6e3
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,发现更多精彩内容 >>
提交
d529a6e3
编写于
8月 01, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(app): nvue
上级
db4f8169
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
36 deletion
+23
-36
packages/uni-cli-nvue/dist/webpack/index.js
packages/uni-cli-nvue/dist/webpack/index.js
+5
-3
packages/uni-cli-nvue/lib/@vue/component-compiler-utils/dist/stylePlugins/scoped.js
...@vue/component-compiler-utils/dist/stylePlugins/scoped.js
+0
-13
packages/uni-cli-nvue/lib/vue-loader/lib/codegen/styleInjection.js
...uni-cli-nvue/lib/vue-loader/lib/codegen/styleInjection.js
+3
-8
packages/uni-cli-nvue/lib/weex-styler/lib/validator.js
packages/uni-cli-nvue/lib/weex-styler/lib/validator.js
+1
-1
packages/uni-cli-nvue/lib/weex-template-compiler/build.js
packages/uni-cli-nvue/lib/weex-template-compiler/build.js
+1
-1
packages/uni-cli-nvue/src/webpack/index.ts
packages/uni-cli-nvue/src/webpack/index.ts
+5
-2
packages/uni-cli-shared/src/json/app/pages/nvue.ts
packages/uni-cli-shared/src/json/app/pages/nvue.ts
+8
-8
未找到文件。
packages/uni-cli-nvue/dist/webpack/index.js
浏览文件 @
d529a6e3
...
...
@@ -19,13 +19,15 @@ function runWebpack(mode, options) {
if
(
stats
.
hasErrors
())
{
return
reject
(
stats
.
toString
());
}
const
info
=
stats
.
toJson
();
if
(
stats
.
hasWarnings
())
{
const
info
=
stats
.
toJson
({
all
:
false
,
warnings
:
true
});
console
.
warn
(
info
.
warnings
);
}
console
.
log
(
stats
.
toString
({
chunks
:
true
,
colors
:
true
,
// 在控制台展示颜色
all
:
false
,
assets
:
true
,
colors
:
true
,
timings
:
true
,
}));
resolve
(
void
0
);
});
...
...
packages/uni-cli-nvue/lib/@vue/component-compiler-utils/dist/stylePlugins/scoped.js
浏览文件 @
d529a6e3
...
...
@@ -54,22 +54,9 @@ exports.default = (options) => {
// So all leading spaces must be eliminated to avoid problems.
selector
.
first
.
spaces
.
before
=
''
;
}
// fixed by xxxxxx (h5,app-plus v3 平台继续使用 attribute,其他平台使用 className)
if
(
process
.
env
.
UNI_PLATFORM
===
'
h5
'
||
(
process
.
env
.
UNI_PLATFORM
===
'
app-plus
'
&&
process
.
env
.
UNI_USING_V3
)
){
selector
.
insertAfter
(
node
,
selectorParser
.
attribute
({
attribute
:
id
}));
}
else
{
selector
.
insertAfter
(
node
,
selectorParser
.
className
({
value
:
id
}));
}
});
}).
processSync
(
node
.
selector
);
});
...
...
packages/uni-cli-nvue/lib/vue-loader/lib/codegen/styleInjection.js
浏览文件 @
d529a6e3
...
...
@@ -87,20 +87,15 @@ module.exports = function genStyleInjectionCode (
})
}
else
{
// fixed by xxxxxx nvue style
styleInjectionCode
=
`if(!this.options.style){this.options.style = {}}
if(Vue.prototype.__merge_style && Vue.prototype.__$appStyle__){Vue.prototype.__merge_style(Vue.prototype.__$appStyle__, this.options.style)}
Vue.prototype.__merge_style(Vue.prototype.__$appStyle__, this.options.style)
`
styles
.
forEach
((
style
,
i
)
=>
{
if
(
isNotEmptyStyle
(
style
))
{
const
request
=
genStyleRequest
(
style
,
i
)
styleInjectionCode
+=
(
`if(Vue.prototype.__merge_style){
Vue.prototype.__merge_style(require(
${
request
}
).default, this.options.style)
}else{
Object.assign(this.options.style,require(
${
request
}
).default)
}\n`
//fixed by xxxxxx 简单处理,与 weex-vue-loader 保持一致
styleInjectionCode
+=
`Vue.prototype.__merge_style(require(
${
request
}
).default, this.options.style)\n`
//fixed by xxxxxx 简单处理,与 weex-vue-loader 保持一致
//`var style${i} = require(${request})\n` +
//`if (style${i}.__inject__) style${i}.__inject__(context)\n`
)
if
(
style
.
module
)
genCSSModulesCode
(
style
,
request
,
i
)
}
})
...
...
packages/uni-cli-nvue/lib/weex-styler/lib/validator.js
浏览文件 @
d529a6e3
...
...
@@ -174,7 +174,7 @@ var EXTENDED_COLOR_KEYWORDS = {
var
LENGTH_REGEXP
=
/^
[
-+
]?\d
*
\.?\d
+
(\S
*
)
$/
var
SUPPORT_CSS_UNIT
=
[
'
px
'
,
'
pt
'
,
'
wx
'
]
if
(
process
.
env
.
UNI_
USING_NVUE_COMPILER
){
if
(
process
.
env
.
UNI_
NVUE_COMPILER
===
'
uni-app
'
){
SUPPORT_CSS_UNIT
.
push
(
'
upx
'
)
SUPPORT_CSS_UNIT
.
push
(
'
rpx
'
)
}
...
...
packages/uni-cli-nvue/lib/weex-template-compiler/build.js
浏览文件 @
d529a6e3
...
...
@@ -4930,7 +4930,7 @@ function genDefaultModel (
var
event
=
lazy
?
'
change
'
:
'
input
'
;
var
valueExpression
=
"
$event.target.attr.value
"
+
(
trim
?
'
.trim()
'
:
''
);
if
(
process
.
env
.
UNI_
USING_NVUE_COMPILER
){
if
(
process
.
env
.
UNI_
NVUE_COMPILER
===
'
uni-app
'
){
valueExpression
=
"
$event.detail.value
"
+
(
trim
?
'
.trim()
'
:
''
);
}
if
(
number
)
{
...
...
packages/uni-cli-nvue/src/webpack/index.ts
浏览文件 @
d529a6e3
...
...
@@ -20,14 +20,17 @@ function runWebpack(
if
(
stats
!
.
hasErrors
())
{
return
reject
(
stats
!
.
toString
())
}
const
info
=
stats
!
.
toJson
()
if
(
stats
!
.
hasWarnings
())
{
const
info
=
stats
!
.
toJson
({
all
:
false
,
warnings
:
true
})
console
.
warn
(
info
.
warnings
)
}
console
.
log
(
stats
!
.
toString
({
chunks
:
true
,
// 使构建过程更静默无输出
all
:
false
,
assets
:
true
,
colors
:
true
,
// 在控制台展示颜色
timings
:
true
,
})
)
resolve
(
void
0
)
...
...
packages/uni-cli-shared/src/json/app/pages/nvue.ts
浏览文件 @
d529a6e3
...
...
@@ -6,22 +6,22 @@ export function initWebpackNVueEntry(pages: UniApp.PagesJsonPageOptions[]) {
process
.
UNI_NVUE_ENTRY
=
{}
pages
.
forEach
((
page
)
=>
{
if
(
page
.
style
.
isNVue
)
{
process
.
UNI_NVUE_ENTRY
[
page
.
path
]
=
genWebpackBase64Code
(
page
.
path
)
process
.
UNI_NVUE_ENTRY
[
page
.
path
]
=
genWebpackBase64Code
(
genNVueEntryCode
(
page
.
path
)
)
}
})
}
function
genWebpackBase64Code
(
route
:
string
)
{
return
`data:text/javascript;base64,
${
Buffer
.
from
(
genNVueEntryCode
(
route
)
).
toString
(
'
base64
'
)}
`
function
genWebpackBase64Code
(
code
:
string
)
{
return
`data:text/javascript;base64,
${
Buffer
.
from
(
code
).
toString
(
'
base64
'
)}
`
}
function
genNVueEntryCode
(
route
:
string
)
{
return
`import App from '
${
normalizePath
(
return
`import '
${
genWebpackBase64Code
(
genNVueAppStyle
())}
'
import App from '
${
normalizePath
(
path
.
resolve
(
process
.
env
.
UNI_INPUT_DIR
,
route
)
)}
.nvue?mpType=page'
${
genNVueAppStyle
()}
)}
.nvue?mpType=page'
if (typeof Promise !== 'undefined' && !Promise.prototype.finally) {
Promise.prototype.finally = function(callback) {
var promise = this.constructor
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录