Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小程序插件模板使用taro-ui路径错误 #3794

Closed
guxingke201 opened this issue Jul 12, 2019 · 6 comments
Closed

小程序插件模板使用taro-ui路径错误 #3794

guxingke201 opened this issue Jul 12, 2019 · 6 comments
Assignees

Comments

@guxingke201
Copy link
Contributor

guxingke201 commented Jul 12, 2019

问题描述
小程序插件模板使用taro-ui路径错误
复现步骤
[复现问题的步骤]

  1. taro init

image

  1. 修改src\plugin\pages\list\list.tsx,引入taro-ui
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import ListItem from '../../components/listItem/listItem'
import { AtButton } from 'taro-ui'
import './list.scss'

export default class List extends Component {
  state = {
    list: [
      {
        name: 'A',
        value: '1'
      },
      {
        name: 'B',
        value: '2'
      },
      {
        name: 'C',
        value: '3'
      }
    ]
  }

  render() {
    return (
      <View>
        {this.state.list.map(item => {
          return <ListItem name={item.name} value={item.value} key={item.name} />
        })}
        <AtButton type='primary' disabled>
          不可操作
        </AtButton>
      </View>
    )
  }
}

list.scss

@import '~taro-ui/dist/style/components/button.scss';
@import '~taro-ui/dist/style/components/loading.scss';
  1. 运行npm run dev:weapp
  2. 运行taro build --plugin weapp --watch
  3. 使用微信开发工具打开根目录,点击Go to pages/list

期望行为
修改taro plugin 构建,正常解析扩展组件路径,正常浏览插件页面

报错信息
image

系统信息
Taro CLI 1.3.5 environment info:
System:
OS: Windows 10
Binaries:
Node: 9.9.0 - H:\node\nodejs\node.EXE
npm: 5.6.0 - H:\node\nodejs\npm.CMD

补充信息
[可选]
[根据你的调查研究,出现这个问题的原因可能在哪里?]
image
../../../npm/taro-ui/多了一级,改为../../npm/taro-ui/就正常了

@taro-bot
Copy link

taro-bot bot commented Jul 12, 2019

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@DreamPWJ
Copy link

这个问题非常严重,严重影响开发效率

@yuche yuche added the CLI label Jul 15, 2019
@taro-bot
Copy link

taro-bot bot commented Jul 15, 2019

CC @luckyadam

@ThatRoy
Copy link

ThatRoy commented Aug 5, 2019

@guxingke201 你好,请问这个问题,现在是只能先手动把打包后文件里的路径改掉吗 ?

@guxingke201
Copy link
Contributor Author

官方没解决,只能手动改了

@Chen-jj
Copy link
Contributor

Chen-jj commented Aug 20, 2019

尽快修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants