基于 angular12 和 ng-zorro-antd 的一些组件,持续更新...
一、组件调用
1、npm i ng-cw-v12 --save
2、app.modules.ts 中import { NgCwModule } from 'ng-cw-v12'
3、app.modules.ts 中@NgModule 中 imports 数组中添加NgCwModule
4、调用测试组件<nc-test></nc-test>
二、服务调用
1、在需要使用的组件中import { NcService } from 'ng-cw-v12'
2、在构造函数中constructor(public ns: NcService) { }
[ncMapType]:'baidu':百度;'gaode':高德;'tianditu':天地图;'tencent':腾讯
[ncToken]:地图服务类型对应token
[ncCity]:搜索城市code;不传默认全国搜索,传值加权对应城市,百度 citycode 链接,高德 citycode 链接,天地图 citycode 链接,腾讯 citycode 链接
[ncPlaceholder]:输入框placeholder,默认值:搜地点
[ncShowType]:1:简易模式 2:详细模式,默认简易模式
(ncClick):搜索列表点击,返回WGS84[lng,lat]
(ncClear):搜索框清空
[ncToken]:彩云天气token
[ncLng]:经度
[ncLat]:经度
[ncInterval]:数据刷新间隔,单位:分钟
[ncPosition]:详情面板相对于bar的位置 rightBottom leftBottom rightTop leftTop
[ncAnimation]:详情面板显示动画,fade:淡入淡出,slide:滑入滑出,默认无动画
[ncShowHourly]:boolean,是否展示24小时预报,默认true
[ncShowDaily]:boolean,是否展示5天预报,默认true
[ncShowLife]:boolean,是否展示生活指数,默认true
[ncSize]:small default large,默认default
[ncFormat]:hexa rgba,默认:hexa
[(ncValue)]:颜色值,双向绑定
(ncOnChange):颜色变化的回调
Run ng generate component component-name --project components
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project components
.
Note: Don't forget to add
--project components
or else it will be added to the default project in yourangular.json
file.
Run ng build components
to build the project. The build artifacts will be stored in the dist/
directory.
After building your library with ng build components
, go to the dist folder cd dist/components
and run npm publish
.
Run ng test components
to execute the unit tests via Karma.
To get more help on the Angular CLI use ng help
or go check out the Angular CLI Overview and Command Reference page.