GithubHelp home page GithubHelp logo

项目配置文件 about remax HOT 10 CLOSED

remaxjs avatar remaxjs commented on August 16, 2024
项目配置文件

from remax.

Comments (10)

yesmeck avatar yesmeck commented on August 16, 2024

为啥区分?

from remax.

Darmody avatar Darmody commented on August 16, 2024

屏幕快照 2019-08-02 18 31 57

配置不同

from remax.

yesmeck avatar yesmeck commented on August 16, 2024

那相同的部分怎么 DRY?

from remax.

Darmody avatar Darmody commented on August 16, 2024

那就 app.config.js,导出 JSON 数据作为配置。这样就可以在 js 里面 DRY,让用户自己控制,比如:

const base = {
  pages: ['pages/index/index', 'pages/new/index', 'pages/login/index'],
}

const title = 'Todo App';
const navigationbarColor = '#323239';

module.exports = {
  weapp: {
    ...base,
    window: {
        backgroundTextStyle: 'light',
        navigationBarBackgroundColor: navigationbarColor,
        navigationBarTitleText: title,
        navigationBarTextStyle: 'white'
      }
    },
  alipay: {
    ...base,
    window: {
        defaultTitle: title,
        titleBarColor: navigationbarColor
    }
  }
};

from remax.

yesmeck avatar yesmeck commented on August 16, 2024

能不能跟 taro 那样也抹平掉这层呢

from remax.

Darmody avatar Darmody commented on August 16, 2024

屏幕快照 2019-08-02 18 52 33

他们没有抹平吧

而且我一直觉得抹平交给开发者做比较好,lib抹平有点不灵活🤔

from remax.

yesmeck avatar yesmeck commented on August 16, 2024

那就 app.alipay.json

from remax.

yesmeck avatar yesmeck commented on August 16, 2024

还是 app.config.js 吧。。

from remax.

Darmody avatar Darmody commented on August 16, 2024

app.config.js LGTM

from remax.

Darmody avatar Darmody commented on August 16, 2024

app.jsonapp.config.jspageconfig 还是 json,会不会有点奇怪,行为不统一 @yesmeck

from remax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.