Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
b4aa9e49
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
718
Star
38705
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
7
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
7
Issue
7
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b4aa9e49
编写于
3月 10, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(qa): add Fake Vue
上级
1696e664
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
76 addition
and
23 deletion
+76
-23
build/build.qa.js
build/build.qa.js
+17
-17
packages/uni-quickapp/components/button/button.vue
packages/uni-quickapp/components/button/button.vue
+1
-1
packages/uni-quickapp/dist/vue.dev.js
packages/uni-quickapp/dist/vue.dev.js
+2
-1
packages/uni-quickapp/dist/vue.prod.js
packages/uni-quickapp/dist/vue.prod.js
+2
-1
packages/uni-quickapp/lib/configure-webpack.js
packages/uni-quickapp/lib/configure-webpack.js
+3
-0
packages/uni-quickapp/lib/loader/app-loader.js
packages/uni-quickapp/lib/loader/app-loader.js
+5
-0
src/platforms/quickapp/runtime/page.js
src/platforms/quickapp/runtime/page.js
+16
-1
src/platforms/quickapp/service/framework/vue.js
src/platforms/quickapp/service/framework/vue.js
+25
-0
src/platforms/quickapp/service/index.js
src/platforms/quickapp/service/index.js
+4
-1
src/platforms/quickapp/view/components/button/button.vue
src/platforms/quickapp/view/components/button/button.vue
+1
-1
未找到文件。
build/build.qa.js
浏览文件 @
b4aa9e49
...
...
@@ -36,31 +36,31 @@ dsl.onInitApp(function({
});`
})
const
appCode
=
appOutput
[
0
].
code
//
const pageBundle = await rollup.rollup(genConfig('page'))
//
const {
//
output: pageOutput
//
} = await pageBundle.generate({
//
format: 'iife',
//
banner: `
//
dsl.onInitPage(function({
//
$app_require$,
//
Vue
//
}) {
//
`,
//
footer: `
//
});`
//
})
//
const pageCode = pageOutput[0].code
const
pageBundle
=
await
rollup
.
rollup
(
genConfig
(
'
page
'
))
const
{
output
:
pageOutput
}
=
await
pageBundle
.
generate
({
format
:
'
iife
'
,
banner
:
`
dsl.onInitPage(function({
$app_require$,
Vue
}) {
`
,
footer
:
`
});`
})
const
pageCode
=
pageOutput
[
0
].
code
const
vueCode
=
fs
.
readFileSync
(
path
.
resolve
(
__dirname
,
'
../packages/uni-quickapp/assets/
'
+
filename
))
fs
.
writeFileSync
(
path
.
resolve
(
__dirname
,
'
../packages/uni-quickapp/dist/
'
+
filename
),
vueCode
+
bridgeCode
+
appCode
,
{
vueCode
+
bridgeCode
+
appCode
+
pageCode
,
{
encoding
:
'
utf8
'
}
)
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
// 命令会执行dev,prod两次,仅prod时执行copy
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
// 命令会执行dev,prod两次,仅prod时执行copy
const
componentsSrc
=
path
.
resolve
(
__dirname
,
'
../src/platforms/quickapp/view/components/**/*
'
)
const
componentsDest
=
path
.
resolve
(
__dirname
,
'
../packages/uni-quickapp/components
'
)
...
...
packages/uni-quickapp/components/button/button.vue
浏览文件 @
b4aa9e49
<
template
>
<div
v-on=
"$listener"
>
<div
v-on=
"$listener
s
"
>
<text>
<slot
/>
</text>
...
...
packages/uni-quickapp/dist/vue.dev.js
浏览文件 @
b4aa9e49
此差异已折叠。
点击以展开。
packages/uni-quickapp/dist/vue.prod.js
浏览文件 @
b4aa9e49
此差异已折叠。
点击以展开。
packages/uni-quickapp/lib/configure-webpack.js
浏览文件 @
b4aa9e49
...
...
@@ -43,6 +43,9 @@ module.exports = {
entry
()
{
return
process
.
UNI_ENTRY
},
externals
:
{
vue
:
'
Vue
'
},
plugins
:
[
new
webpack
.
DefinePlugin
({
// 平台:na
...
...
packages/uni-quickapp/lib/loader/app-loader.js
0 → 100644
浏览文件 @
b4aa9e49
//import uni-pages
//解析main.js中全局组件?
module
.
exports
=
function
(
source
,
map
)
{
}
src/platforms/quickapp/runtime/page.js
浏览文件 @
b4aa9e49
// 快应用vue组件样式需要被合并到独立的css.json中,目前采用easycom实时编译
/* eslint-disable no-undef */
if
(
typeof
__VueOptions
!==
'
undefined
'
)
{
// 将 main.js 中的 store,use,mixin 同步到 page
const
{
uses
,
mixins
,
store
}
=
__VueOptions
uses
&&
uses
.
forEach
(
use
=>
{
Vue
.
use
(
use
)
})
mixins
&&
mixins
.
forEach
(
mixin
=>
{
Vue
.
mixin
(
mixin
)
})
store
&&
(
Vue
.
prototype
.
$store
=
store
)
}
src/platforms/quickapp/service/framework/vue.js
0 → 100644
浏览文件 @
b4aa9e49
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
const
vueOptions
=
Object
.
create
(
null
)
function
Vue
(
options
)
{
if
(
options
&&
options
.
store
)
{
vueOptions
.
store
=
options
.
store
}
}
Vue
.
use
=
function
(
plugin
)
{
(
vueOptions
.
uses
||
(
vueOptions
.
uses
=
[])).
push
(
plugin
)
}
Vue
.
mixin
=
function
(
mixin
)
{
(
vueOptions
.
mixins
||
(
vueOptions
.
mixins
=
[])).
push
(
mixin
)
}
Vue
.
component
=
function
()
{}
injectRef
.
__VueOptions
=
vueOptions
// 目前仅支持 store, use, mixin
export
default
Vue
src/platforms/quickapp/service/index.js
浏览文件 @
b4aa9e49
...
...
@@ -5,6 +5,8 @@ import {
import
{
invokeCallbackHandler
}
from
'
uni-helpers/api
'
import
Vue
from
'
./framework/vue
'
import
{
getApp
...
...
@@ -19,7 +21,8 @@ global.UniServiceJSBridge.invokeCallbackHandler = invokeCallbackHandler
// TODO 补充__uniRoutes?路由校验那里用到了
export
default
{
uni
,
uni
,
Vue
,
getApp
,
getCurrentPages
}
src/platforms/quickapp/view/components/button/button.vue
浏览文件 @
b4aa9e49
<
template
>
<div
v-on=
"$listener"
>
<div
v-on=
"$listener
s
"
>
<text>
<slot
/>
</text>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录