Skip to content

Commit

Permalink
Merge pull request #1288 from didi/fix-swan-page-initsetup
Browse files Browse the repository at this point in the history
fix: 百度小程序page使用setup报错
  • Loading branch information
hiyuki committed Oct 17, 2023
2 parents 5113951 + b0a31e6 commit 7dc760a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/webpack-plugin/lib/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ module.exports = function (content) {
let ctor = 'App'
if (ctorType === 'page') {
// swan也默认使用Page构造器
if (mpx.forceUsePageCtor || mode === 'ali' || mode === 'swan') {
if (mpx.forceUsePageCtor || mode === 'ali') {
ctor = 'Page'
} else {
ctor = 'Component'
Expand Down
2 changes: 1 addition & 1 deletion packages/webpack-plugin/lib/native-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ module.exports = function (content) {
let ctorType = 'app'
if (pagesMap[resourcePath]) {
ctorType = 'page'
if (mpx.forceUsePageCtor || mode === 'ali' || mode === 'swan') {
if (mpx.forceUsePageCtor || mode === 'ali') {
ctor = 'Page'
} else {
ctor = 'Component'
Expand Down

0 comments on commit 7dc760a

Please sign in to comment.