cipchk / ngx-weui

WeUI for angular
https://cipchk.github.io/ngx-weui/
MIT License
424 stars 102 forks source link

请问5.0.2版本现在支持Angular6么? #103

Closed wangtao closed 6 years ago

wangtao commented 6 years ago

============

之前用的Angular 5.2 和 ngx-weui 3.0.0, 正常使用

手贱升级了Angular 6.0.2, 然后更新ngx-weui到5.0.2, 发现不能正常用了

import报错

import { SkinType, InputType } from 'ngx-weui'; import { DialogService, DialogConfig, DialogComponent } from 'ngx-weui/dialog';

这么写会导致下面错误 :

TS2305: Module '"C:/Development/projects/Angular/zytax-wx-test/node_modules/ngx-weui/weui"' has no exported member 'SkinType' TS2307: Cannot find module 'ngx-weui/dialog'

WebStorm自动完成会改成下面方式:

import {DialogService} from 'ngx-weui/src/dialog/dialog.service'; import {DialogConfig} from 'ngx-weui/src/dialog/dialog.config'; import {ActionSheetConfig} from 'ngx-weui/src/actionsheet/actionsheet.config'; import {ActionSheetService} from 'ngx-weui/src/actionsheet/actionsheet.service';

编译没错了,然而, 启动服务器会报:

Module not found: Error: Can't resolve 'ngx-weui/src/actionsheet/actionsheet.service' in .....

之类

============

Bug Report or Feature Request (mark with an x)


[ ] Bug report -> please search issues before submitting
[x] Feature request
[ ] Documentation issue or request

Current behavior

Expected behavior

Environment


Angular version: 6.0.2
ngx-weui version: 5.0.2
Browser:
- [ ] Chrome (desktop) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX

Others:
cipchk commented 6 years ago

5.2.0 不支持 ngx-weui/dialog 这类用法,所有都采用 ngx-weui。目前的 Tree Shaking 已经足够智能,没有必要按模块导入这类蹩脚的方式。