小编Jus*_*ake的帖子

找不到模块:无法解析“material-ui/AutoComplete”

我安装了 material-ui-search-bar 然后我想使用 SearchBar。但我有下一个问题:

./node_modules/material-ui-search-bar/lib/components/SearchBar/SearchBar.js
Module not found: Can't resolve 'material-ui/AutoComplete' in '...node_modules/material-ui-search-bar/lib/components/SearchBar'
Run Code Online (Sandbox Code Playgroud)

我该如何解决?

reactjs material-design redux material-ui react-redux

24
推荐指数
4
解决办法
5万
查看次数

ReactJS 在 src/ 目录外导入组件

我有两个反应应用程序(A-app,B-app)。我需要将一个组件从 A-app 导入到 B-app。但是当我尝试这样做时,我看到了这个错误。

./src/App.js
Module not found: You attempted to import ../../src/components/Dashboard/container which falls outside of the project src/ directory. Relative imports outside of src/ are not supported. You can either move it inside src/, or add a symlink to it from project's node_modules/.
Run Code Online (Sandbox Code Playgroud)

我试图在 B-app node_modules 中的这个组件上做符号链接。但它没有用。

我还尝试在根项目目录中创建 .env 文件并将其放入NODE_PATH=src/ 文件中。但是这个解决方案也不起作用。

我怎样才能解决这个问题?

对不起我的英语不好。

javascript ecmascript-6 reactjs

9
推荐指数
3
解决办法
3万
查看次数

django.db.utils.IntegrityError:列“color_set_id”包含空值

应用模型.py

class ColorSet(models.Model):
    color = models.CharField(max_length=50, verbose_name='Color', default='', blank=True, null=True)
    code = models.CharField(max_length=50, verbose_name='Code of color', default='', blank=True, null=True)

    class Meta:
        verbose_name = 'Color'
        verbose_name_plural = 'Colors'
Run Code Online (Sandbox Code Playgroud)

还有 project.models.py

class Product(models.Model):
    title = models.CharField(max_length=200, verbose_name='Title of product')
    slug_field = models.SlugField(max_length=50, verbose_name='Slug', default='')
    description = models.TextField(verbose_name='Description')
    color_set = models.ForeignKey(ColorSet, verbose_name='Color', default='', blank=True, null=True)

    def __str__(self):
        return '%s %s %s' % (self.title, '->', self.category)

    class Meta:
        verbose_name = "Product"
        verbose_name_plural = "Products"
Run Code Online (Sandbox Code Playgroud)

如果我在做“迁移”,我会看到这样的东西

Traceback (most recent call last):
File "manage.py", line 22, …
Run Code Online (Sandbox Code Playgroud)

python django django-models django-admin python-3.x

4
推荐指数
1
解决办法
4243
查看次数