Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
20岁爱吃必胜客
uni-app
提交
49caf73a
U
uni-app
项目概览
20岁爱吃必胜客
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
49caf73a
编写于
10月 14, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(v3): remove static attrs (service)
上级
e0385a20
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
15 deletion
+18
-15
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+6
-7
packages/uni-template-compiler/__tests__/compiler-app-plus.service.spec.js
...late-compiler/__tests__/compiler-app-plus.service.spec.js
+4
-4
packages/uni-template-compiler/__tests__/demo.js
packages/uni-template-compiler/__tests__/demo.js
+3
-3
packages/uni-template-compiler/lib/app/service.js
packages/uni-template-compiler/lib/app/service.js
+5
-1
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
49caf73a
...
...
@@ -6226,7 +6226,7 @@ var serviceContext = (function () {
let
todoNavigator
=
false
;
function
navigate
(
path
,
callback
)
{
function
navigate
(
path
,
callback
)
{
{
if
(
todoNavigator
)
{
return
console
.
error
(
`已存在待跳转页面
${
todoNavigator
.
path
}
,请不要连续多次跳转页面`
)
...
...
@@ -6254,7 +6254,7 @@ var serviceContext = (function () {
}
}
function
todoNavigate
()
{
function
todoNavigate
()
{
if
(
!
todoNavigator
)
{
return
}
...
...
@@ -6268,7 +6268,7 @@ var serviceContext = (function () {
return
navigate
()
}
function
navigateFinish
()
{
function
navigateFinish
()
{
{
// 创建预加载
const
preloadWebview
=
createPreloadWebview
();
...
...
@@ -6278,9 +6278,9 @@ var serviceContext = (function () {
if
(
todoNavigator
.
nvue
)
{
return
todoNavigate
()
}
preloadWebview
.
loaded
?
todoNavigator
.
navigate
()
:
registerWebviewReady
(
preloadWebview
.
id
,
todoNavigate
);
preloadWebview
.
loaded
?
todoNavigator
.
navigate
()
:
registerWebviewReady
(
preloadWebview
.
id
,
todoNavigate
);
}
}
...
...
@@ -8859,7 +8859,6 @@ var serviceContext = (function () {
'
uni-page-refresh
'
,
'
uni-actionsheet
'
,
'
uni-modal
'
,
'
uni-picker
'
,
'
uni-toast
'
,
'
uni-resize-sensor
'
,
...
...
packages/uni-template-compiler/__tests__/compiler-app-plus.service.spec.js
浏览文件 @
49caf73a
...
...
@@ -190,7 +190,7 @@ describe('codegen', () => {
it
(
'
generate slot target
'
,
()
=>
{
assertCodegen
(
'
<p slot="one">hello world</p>
'
,
`with(this){return _c('p',{attrs:{"
slot":"one","
_i":0},slot:"one"})}`
`with(this){return _c('p',{attrs:{"_i":0},slot:"one"})}`
)
})
...
...
@@ -291,7 +291,7 @@ describe('codegen', () => {
it
(
'
generate static attrs
'
,
()
=>
{
assertCodegen
(
'
<input name="field1">
'
,
`with(this){return _c('input',{attrs:{"
name":"field1","
_i":0}})}`
`with(this){return _c('input',{attrs:{"_i":0}})}`
)
})
...
...
@@ -558,14 +558,14 @@ describe('codegen', () => {
it
(
'
generate component
'
,
()
=>
{
assertCodegen
(
'
<my-component name="mycomponent1" :msg="msg" @notify="onNotify"><div>hi</div></my-component>
'
,
`with(this){return _c('my-component',{attrs:{"
name":"mycomponent1","
msg":msg,"_i":0},on:{"notify":onNotify}},[_c('div',{attrs:{"_i":1}})])}`
`with(this){return _c('my-component',{attrs:{"msg":msg,"_i":0},on:{"notify":onNotify}},[_c('div',{attrs:{"_i":1}})])}`
)
})
it
(
'
generate svg component with children
'
,
()
=>
{
assertCodegen
(
'
<svg><my-comp><circle :r="10"></circle></my-comp></svg>
'
,
`with(this){return _c('svg',{attrs:{"_i":0}},[_c('my-comp',{attrs:{"_i":1}},[_c('circle',{attrs:{"
r":10,"
_i":2}})])],1)}`
`with(this){return _c('svg',{attrs:{"_i":0}},[_c('my-comp',{attrs:{"_i":1}},[_c('circle',{attrs:{"_i":2}})])],1)}`
)
})
...
...
packages/uni-template-compiler/__tests__/demo.js
浏览文件 @
49caf73a
...
...
@@ -2,15 +2,15 @@ const compiler = require('../lib')
const
res
=
compiler
.
compile
(
`
<view>
<
page-head v-if="a" v-for="item in items" :title="title"></page-head
>
<
image src="aaaa" :a="b"/
>
</view>
`
,
{
resourcePath
:
'
/User/fxy/Documents/test.wxml
'
,
mp
:
{
platform
:
'
app-plus
'
},
//
service: true
view
:
true
service
:
true
//
view: true
})
console
.
log
(
require
(
'
util
'
).
inspect
(
res
,
{
colors
:
true
,
...
...
packages/uni-template-compiler/lib/app/service.js
浏览文件 @
49caf73a
...
...
@@ -21,7 +21,6 @@ function genData (el) {
dynamicTexts
,
directivesBinding
}
=
el
let
extras
=
''
if
(
directivesBinding
)
{
...
...
@@ -265,12 +264,17 @@ function processText (el) {
}
}
function
processAttrs
(
el
)
{
el
.
attrs
=
el
.
attrs
.
filter
(
attr
=>
attr
.
name
===
ID
||
isVar
(
attr
.
value
))
}
function
postTransformNode
(
el
)
{
parseEvent
(
el
)
removeStatic
(
el
)
renameBinding
(
el
)
processAttrs
(
el
)
processText
(
el
)
updateForEleId
(
el
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录