查看: 44|回覆: 0

Angular BootStrap 登录页面

[複製鏈接]

4

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2009-4-25
發表於 2020-5-24 19:50:00 | 顯示全部樓層 |閲讀模式
#安装angular
npm install -g @angular/cli
#新建项目
ng new familyxiaologinui
# 打开设置
cd familyxiaologinui
ng serve --open --port 4100
#引入Bootstrap
npm install bootstrap@4.0.0-beta.2 popper.js jquery --save
#安装  https://www.npmjs.com/package/angular-font-awesome
npm install --save font-awesome angular-font-awesome



 

//文件 angular.json
{"projects": {"architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {"styles": [
              "src/styles.less",
              "./node_modules/font-awesome/css/font-awesome.css",
              "./node_modules/bootstrap/dist/css/bootstrap.min.css"
            ],
            "scripts": [
              "./node_modules/jquery/dist/jquery.slim.min.js",
              "./node_modules/popper.js/dist/umd/popper.min.js",
              "./node_modules/bootstrap/dist/js/bootstrap.min.js"
            ]
          }
        }
      }
    }
  }
}

 

#生成登录Form
ng g c components/common/loginform
#进入https://www.bootcss.com/,选择BootStrap4中文网->"实例(https://v4.bootcss.com/docs/examples/)"->Sign-In(https://v4.bootcss.com/docs/examples/sign-in/)->右键“查看网页源代码”
#将form中的内容得到到->loginform.component.less(对应组件的样式中)

注意:引用了第三方样式,要重启一下(我使用的是vscode)

到此简单登录页常写好了,手机效果还不错

 

PS E:\...> ng serve --open --port 4110
An unhandled exception occurred: Script file ./node_modules/popper.js/dist/umd/popper.min.js does not exist.
See "C:\Users\ADMINI~1\AppData\Local\Temp\2\ng-MVucsE\angular-errors.log" for further details.

npm install popper.js
An unhandled exception occurred: Script file ./node_modules/jquery/dist/jquery.slim.min.js does not exist.
See "C:\Users\ADMINI~1\AppData\Local\Temp\2\ng-FGZkaF\angular-errors.log" for further details.
PS E:\...> npm install jquery

 

 

 

 



来源:https://www.cnblogs.com/xiaoruilin/p/12952353.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部