Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
89c7fe9d
U
uni-app
项目概览
DCloud
/
uni-app
3 个月 前同步成功
通知
725
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,发现更多精彩内容 >>
提交
89c7fe9d
编写于
12月 20, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: wxs (question/136633)
上级
13eb8b49
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
53 addition
and
17 deletion
+53
-17
packages/uni-app-vue/dist/service.runtime.esm.dev.js
packages/uni-app-vue/dist/service.runtime.esm.dev.js
+1
-1
packages/uni-app-vue/dist/service.runtime.esm.prod.js
packages/uni-app-vue/dist/service.runtime.esm.prod.js
+1
-1
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+2
-2
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+1
-1
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+1
-1
packages/uni-shared/src/vue.ts
packages/uni-shared/src/vue.ts
+2
-2
packages/vite-plugin-uni/src/cli/build.ts
packages/vite-plugin-uni/src/cli/build.ts
+15
-2
packages/vite-plugin-uni/src/cli/nvue.ts
packages/vite-plugin-uni/src/cli/nvue.ts
+0
-6
packages/vite-plugin-uni/src/index.ts
packages/vite-plugin-uni/src/index.ts
+7
-1
packages/vite-plugin-uni/src/utils/index.ts
packages/vite-plugin-uni/src/utils/index.ts
+1
-0
packages/vite-plugin-uni/src/utils/polyfill.ts
packages/vite-plugin-uni/src/utils/polyfill.ts
+22
-0
未找到文件。
packages/uni-app-vue/dist/service.runtime.esm.dev.js
浏览文件 @
89c7fe9d
...
...
@@ -79,7 +79,7 @@ export default function vueFactory(exports) {
}
=
instance
;
// ShapeFlags.ARRAY_CHILDREN = 1<<4
if
(
subTree
.
shapeFlag
&
16
)
{
var
elemVNode
=
subTree
.
children
.
find
(
vnode
=>
isElement
(
vnode
.
el
));
var
elemVNode
=
subTree
.
children
.
find
(
vnode
=>
vnode
.
el
&&
isElement
(
vnode
.
el
));
if
(
elemVNode
)
{
return
elemVNode
.
el
;
...
...
packages/uni-app-vue/dist/service.runtime.esm.prod.js
浏览文件 @
89c7fe9d
...
...
@@ -77,7 +77,7 @@ export default function vueFactory(exports) {
}
=
instance
;
// ShapeFlags.ARRAY_CHILDREN = 1<<4
if
(
subTree
.
shapeFlag
&
16
)
{
var
elemVNode
=
subTree
.
children
.
find
(
vnode
=>
isElement
(
vnode
.
el
));
var
elemVNode
=
subTree
.
children
.
find
(
vnode
=>
vnode
.
el
&&
isElement
(
vnode
.
el
));
if
(
elemVNode
)
{
return
elemVNode
.
el
;
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
89c7fe9d
...
...
@@ -4626,11 +4626,11 @@ const ChooseLocationProtocol = {
longitude: Number
};
const API_GET_LOCATION = "getLocation";
const coordTypes = ["
WGS84", "GCJ
02"];
const coordTypes = ["
wgs84", "gcj
02"];
const GetLocationOptions = {
formatArgs: {
type(value, params) {
value = (value || "").to
Upp
erCase();
value = (value || "").to
Low
erCase();
if (coordTypes.indexOf(value) === -1) {
params.type = coordTypes[0];
} else {
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
89c7fe9d
...
...
@@ -184,7 +184,7 @@ function resolveOwnerEl(instance) {
const
{
subTree
}
=
instance
;
// ShapeFlags.ARRAY_CHILDREN = 1<<4
if
(
subTree
.
shapeFlag
&
16
)
{
const
elemVNode
=
subTree
.
children
.
find
((
vnode
)
=>
isElement
(
vnode
.
el
));
const
elemVNode
=
subTree
.
children
.
find
((
vnode
)
=>
vnode
.
el
&&
isElement
(
vnode
.
el
));
if
(
elemVNode
)
{
return
elemVNode
.
el
;
}
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
89c7fe9d
...
...
@@ -180,7 +180,7 @@ function resolveOwnerEl(instance) {
const
{
subTree
}
=
instance
;
// ShapeFlags.ARRAY_CHILDREN = 1<<4
if
(
subTree
.
shapeFlag
&
16
)
{
const
elemVNode
=
subTree
.
children
.
find
((
vnode
)
=>
isElement
(
vnode
.
el
));
const
elemVNode
=
subTree
.
children
.
find
((
vnode
)
=>
vnode
.
el
&&
isElement
(
vnode
.
el
));
if
(
elemVNode
)
{
return
elemVNode
.
el
;
}
...
...
packages/uni-shared/src/vue.ts
浏览文件 @
89c7fe9d
...
...
@@ -30,8 +30,8 @@ export function resolveOwnerEl(instance: ComponentInternalInstance) {
const
{
subTree
}
=
instance
// ShapeFlags.ARRAY_CHILDREN = 1<<4
if
(
subTree
.
shapeFlag
&
16
)
{
const
elemVNode
=
(
subTree
.
children
as
VNode
[]).
find
(
(
vnode
)
=>
isElement
(
vnode
.
el
as
Element
)
const
elemVNode
=
(
subTree
.
children
as
VNode
[]).
find
(
(
vnode
)
=>
vnode
.
el
&&
isElement
(
vnode
.
el
as
Element
)
)
if
(
elemVNode
)
{
return
elemVNode
.
el
...
...
packages/vite-plugin-uni/src/cli/build.ts
浏览文件 @
89c7fe9d
import
path
from
'
path
'
import
fs
from
'
fs-extra
'
import
{
build
as
buildByVite
,
BuildOptions
,
InlineConfig
}
from
'
vite
'
import
{
extend
}
from
'
@vue/shared
'
import
{
initPreContext
,
normalizeAppManifestJson
,
...
...
@@ -11,8 +12,20 @@ import { CliOptions } from '.'
import
{
addConfigFile
,
cleanOptions
}
from
'
./utils
'
export
async
function
build
(
options
:
CliOptions
)
{
if
(
options
.
platform
===
'
app
'
&&
(
options
as
BuildOptions
).
manifest
)
{
return
buildManifestJson
()
if
(
options
.
platform
===
'
app
'
)
{
if
((
options
as
BuildOptions
).
manifest
)
{
return
buildManifestJson
()
}
if
(
process
.
env
.
UNI_RENDERER
===
'
native
'
)
{
return
buildByVite
(
addConfigFile
(
extend
(
{
nvue
:
true
},
initBuildOptions
(
options
,
cleanOptions
(
options
)
as
BuildOptions
)
)
)
)
}
}
return
buildByVite
(
addConfigFile
(
...
...
packages/vite-plugin-uni/src/cli/nvue.ts
浏览文件 @
89c7fe9d
...
...
@@ -10,12 +10,6 @@ export function initNVueEnv() {
const
manifestJson
=
parseManifestJsonOnce
(
process
.
env
.
UNI_INPUT_DIR
)
if
(
getAppRenderer
(
manifestJson
)
===
'
native
'
)
{
process
.
env
.
UNI_RENDERER
=
'
native
'
return
(
console
.
error
(
`当前项目启用了纯原生渲染,请在manifest.json中切换vue版本为2之后,再重新运行。`
),
process
.
exit
(
1
)
)
}
const
nvueCompiler
=
getNVueCompiler
(
manifestJson
)
if
(
nvueCompiler
===
'
uni-app
'
)
{
...
...
packages/vite-plugin-uni/src/index.ts
浏览文件 @
89c7fe9d
...
...
@@ -17,7 +17,11 @@ import {
import
{
createConfig
}
from
'
./config
'
import
{
createConfigResolved
}
from
'
./configResolved
'
import
{
uniCopyPlugin
}
from
'
./plugins/copy
'
import
{
initExtraPlugins
,
initPluginUniOptions
}
from
'
./utils
'
import
{
initExtraPlugins
,
initPluginUniOptions
,
rewriteCompilerSfcParse
,
}
from
'
./utils
'
import
{
initPluginViteLegacyOptions
,
initPluginVueJsxOptions
,
...
...
@@ -31,6 +35,8 @@ const pkg = require(path.resolve(__dirname, '../package.json'))
initModuleAlias
()
rewriteCompilerSfcParse
()
process
.
env
.
UNI_COMPILER_VERSION
=
pkg
[
'
uni-app
'
]?.[
'
compilerVersion
'
]
||
''
process
.
env
.
UNI_COMPILER_VERSION_TYPE
=
pkg
.
version
.
includes
(
'
alpha
'
)
?
'
a
'
...
...
packages/vite-plugin-uni/src/utils/index.ts
浏览文件 @
89c7fe9d
export
*
from
'
./filter
'
export
*
from
'
./plugin
'
export
*
from
'
./polyfill
'
packages/vite-plugin-uni/src/utils/polyfill.ts
0 → 100644
浏览文件 @
89c7fe9d
import
path
from
'
path
'
import
{
EXTNAME_VUE
,
resolveBuiltIn
}
from
'
@dcloudio/uni-cli-shared
'
import
{
SFCParseOptions
}
from
'
@vue/compiler-sfc
'
/**
* TODO 临时重写,解决 @vitejs/plugin-vue 的 Bug
*/
export
function
rewriteCompilerSfcParse
()
{
// @ts-ignore
const
compilerSfc
=
require
(
resolveBuiltIn
(
'
@vue/compiler-sfc
'
))
const
{
parse
}
=
compilerSfc
compilerSfc
.
parse
=
(
source
:
string
,
options
:
SFCParseOptions
)
=>
{
if
(
options
.
filename
)
{
const
extname
=
path
.
extname
(
options
.
filename
)
// wxs、filter、renderjs
if
(
extname
&&
!
EXTNAME_VUE
.
includes
(
extname
))
{
const
tag
=
extname
.
slice
(
1
)
source
=
`<
${
tag
}
>`
+
source
+
`</
${
tag
}
>`
}
}
return
parse
(
source
,
options
)
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录