如何将meanjs v0.4.2默认应用程序与bootstrap v3.3.7主题集成

How to integrate a meanjs v0.4.2 default app with a bootstrap v3.3.7 theme

本文关键字:v3 bootstrap 集成 应用程序 meanjs v0 默认      更新时间:2023-09-26

我已经知道如何集成Python-flask和WordPress与Bootstrap。我还知道如何使用generator-meanjs的yeomon CRUD模块子生成器添加和更改新CRUD模块的行为和视图。然而,我现在被meanjs.org平均堆栈应用程序生成器生成的文件结构所淹没。我知道与MVC模式相关的一般文件结构和交互。但是,我如何集成与bootstrap v3.3.7主题生成的meanjs.org v0.4.2默认应用程序。我可以让它以某种方式工作,但我更愿意从一开始就以正确的方式设置它。

安装完meanjs的所有依赖项(nodejs, npm, bower ruby, sass, grunt-cli)后,包括使用全局meanjs框架的yeamon生成器:

sudo npm install -g yo
sudo npm install -g generator-meanjs

和生成默认的应用框架:

yo meanjs

使用这个CLI菜单选择:

What mean.js version would you like to generate? 0.4.2
In which folder would you like the project to be generated? This can be changed later. (mean)
What would you like to call your application? (MEAN)
How would you describe your application? (Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js)
How would you describe your application in comma separated key words? (MongoDB, Express, AngularJS, and Node.js)
What is your company/author name? AUTHOR
Would you like to generate the article example CRUD module? Y
Would you like to generate the chat example module? Y

这个文件夹结构可能与引导相关的文件被指出:

/mean
  /config
    (some folders and files with configurations)
  /modules
    /core
      /client
        /controllers
          header.client.controller.js
          home.client.controller.js
        /css
          core.css
        /views
          (some other html files)
        (some other folders)
      /server
        /controllers
          core.server.controllers.js
          errors.server.controller.js
        /routes
          core.server.routes.js
        /services
          menus.client.service.js
          (another folder and js file)
        /views
          index.server.view.html
          layout.server.view.html
          (some other html files)
        (another js file)
      /tests
        (nested folders /client and /server)
    /users
      (same structure like /core folder)
    (and /articles and /chat which yould not be existend dependent on the cli menu selection)
  /node_modules
    (a lot of node modules)
  /public
    /lib
      /angular-bootstrap
        (some js, json and css files)
      /bootstrap
        (some folders and files)
      (some other angular, jquery and other stuff)
  /scripts
    (shell and js script)
  .bluemix
  .git
(a lot of environment/tool configuration files)
(some javascript files ~ environment/tools)

主题文件夹/文件结构如下:

/css
  bootstrap.css (= bootstrap v3.3.7 !?)
  bootstrap.min.css (= bootstrap v3.3.7 !?)
  scrolling-nav.css (theme specfic)
/fonts
  (.eot, .svg, .ttf, woff and .woff2 glyphicons)
/js
  bootstrap.js (= bootstrap v3.3.7 !?)
  bootstrap.min.js (= bootstrap v3.3.7 !?)
  jquery.easing.min.js (= bootstrap v3.3.7 !?)
  jquery.js (= bootstrap v3.3.7 !?)
  scrolling-nav.js (theme specifc)
index.hmtl (theme specific)
(license and readme file)

我真的不确定你的意思是集成bootstrap与Meanjs,据我所知,它已经集成在默认的应用程序。如果你去config/assets/default.jsconfig/assets/production.js(一个是用于开发,另一个用于生产)在client.lib.cssclient.lib.js引导模块被指定。当应用程序启动时,这些模块在modules/core/server/views/layout.server.view.html中加载,就在<!-- Application CSS Files --><!--Application JavaScript Files-->注释下。

如果您想升级到最新的Bootstrap,只需更改bower.json文件中的版本号并运行命令bower update