Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

单独的page页面写的main.json除了标题能改变 其他配置都会被全局main.json样式覆盖 #1156

Closed
Megan-TA opened this issue Nov 3, 2018 · 6 comments

Comments

@Megan-TA
Copy link

Megan-TA commented Nov 3, 2018

[问题简单描述]

单独的page页面写的main.json除了标题能改变 其他配置都会被全局main.json样式覆盖

比如:
pags/list/main.json 下定义整个列表页的背景色是白色 而外部全部全局的背景色是红色,最后所有的page都是红色。

期望的表现:

每个页面的main.json可以覆盖全局设置的默认页面样式

@Megan-TA
Copy link
Author

Megan-TA commented Nov 3, 2018

"mpvue-loader": "^1.1.2" 已更新多送1.1.1版本以上

@F-loat
Copy link
Contributor

F-loat commented Nov 30, 2018

查看下 dist 目录下生成的文件是否有问题

@shen-lan
Copy link

shen-lan commented Dec 4, 2018

"usingComponents": {
    "van-button": "../../../static/vant/button/index",
    "van-icon": "/static/vant/icon/index",
    "van-popup": "/static/vant/popup/index",
    "van-action-sheet": "/static/vant/action-sheet/index"
  },
  "window": {
    "navigationBarTitleText": "小威位置-登录",
    "navigationBarBackgroundColor": "#ffffff",
    "navigationBarTextStyle": "black",
    "backgroundColor": "#red"
  }
}

这是生成的。依然没有覆盖app.js设置的,请问怎么回事?

@F-loat
Copy link
Contributor

F-loat commented Dec 4, 2018

你的配置有问题吧,页面的不需要 window 应该,看下小程序的文档

@shen-lan
Copy link

shen-lan commented Dec 4, 2018

export default {
    config: {
        "usingComponents": {
            "van-button": "/static/vant/button/index",
            "van-icon": "/static/vant/icon/index",
            "van-popup": "/static/vant/popup/index",
            "van-action-sheet": "/static/vant/action-sheet/index"
        },
        "navigationBarTitleText": "小威位置-登录",
        "navigationBarBackgroundColor": "#ffffff",
        "navigationBarTextStyle": "black",
        "backgroundColor": "#red"      
    }
}

改成这样可以了 ....多谢

@hucq hucq closed this as completed Dec 11, 2018
@wuxiaolan91
Copy link

wuxiaolan91 commented Dec 29, 2018

@shen-lan
我更新成楼上这样子标题也还是不出来
"mpvue-loader": "^1.1.2",
代码

const app = new Vue(App)
app.$mount()
export default {
  config: {
    'navigationBarTitleText': '最新约稿函'
  }
}

标题啊还是全局配置的那个标题.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants