小编Bma*_*max的帖子

导出变量“store”具有或正在使用外部模块错误 Redux 工具包和 redux 的名称“$CombinedState”

您好,我试图让 redux 继续使用 redux 工具包(也在打字稿中),但出现以下错误:

Exported variable 'store' has or is using name '$CombinedState' from external module "home/..../node_modules/redux/index" but cannot be named.

我看到这个问题之前在这里被问过,但也没有得到回答。

以下是我的代码,如果您有解决此问题的想法,请告诉我,谢谢

import { configureStore, getDefaultMiddleware } from "@reduxjs/toolkit";
import {combineReducers} from 'redux';
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
import myModuleReducer from "../../modules/my-module/redux/my-module-slice";
import myModuleTwoReducer from "../../modules/my-module-two/redux/my-module-two-slice";

import {
  persistStore,
  persistReducer,
  FLUSH,
  REHYDRATE,
  PAUSE,
  PERSIST,
  PURGE,
  REGISTER,
} from 'redux-persist'
import storage from 'redux-persist/lib/storage' // defaults to localStorage for web

const persistConfig = { …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs redux redux-toolkit

7
推荐指数
1
解决办法
5171
查看次数

Angular 4获得dom元素

嗨,我想在Angular 4应用程序上单击编辑按钮后将焦点设置在输入元素上.

首先我尝试了Renderer2,但它似乎并不适用于此目的.

现在我正在尝试使用@ViewChild,我总是得到未定义的价值.

我事件尝试实现AfterViewInit并在加载后立即记录该元素,但我仍然得到'未定义'.请帮忙..

        import { Component, OnInit, Input, Output, EventEmitter, Renderer2, ViewChild, AfterViewInit } from '@angular/core';
        import { NgIf } from '@angular/common';
        import { DataService } from '../data.service';
        import { NgForm } from '@angular/forms';

        @Component({
            selector: 'app-artist-list-item',
            template: `
                    <button class="w3-button w3-circle w3-orange" (click)="edit(nameInput)"><i class="fa fa-pencil"></i></button>
                    <span *ngIf="editable">
                        <input  class="name" #nameInput (keyup)="onKey(nameInput.value)" (keypress)="inputEnter($event)" [value]="artist.name">
                        <button class="w3-button w3-green btn-save" (click)="save()">Save</button>
                    </span>
                    <span *ngIf="!editable">
                        {{artist.name}}
                    </span>
            `,
            styleUrls: ['./artist-list-item.component.scss']
        })
        export class ArtistListItemComponent implements OnInit, AfterViewInit {

            @Input() artist: any; …
Run Code Online (Sandbox Code Playgroud)

single-page-application typescript angular

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

Vim全局变量检查在lua中抛出错误(neovim插件开发)

我正在尝试使用 lua 编写一个 neovim 插件,当检查变量是否存在时,lua 抛出一个错误,如下所示:Undefined variable: g:my_var

方法一:

local function open_bmax_term()
    if (vim.api.nvim_eval("g:my_var")) then
        print('has the last buff')
    else
        print('has no the last buff')
    end
end
Run Code Online (Sandbox Code Playgroud)

方法二:


local function open_bmax_term()
    if (vim.api.nvim_get_var("my_var")) then
        print('has the last buff')
    else
        print('has no the last buff')
    end
end
Run Code Online (Sandbox Code Playgroud)

这是一个类似的函数,它viml可以工作:(这不会引发任何错误)

fun! OpenBmaxTerm()

    if exists("g:my_var")
        echo "has the last buff"
    
    else
        echo "has no the last buff"
    endif
endfun
Run Code Online (Sandbox Code Playgroud)

知道如何让它在 lua 中工作吗?我尝试将条件包装在 a 中pcall,其效果就像使其始终为真。

lua vim-plugin neovim

6
推荐指数
2
解决办法
6949
查看次数

如何在wordpress中不刷新页面的情况下提交联系表格7?

嗨,我是联系表格 7 的新手。我在 Youtube 教程中看到过,联系表格 7 提交时无需刷新页面。但是当我安装插件时,它会刷新页面。

请告知如何使其在不刷新页面的情况下工作。谢谢。

wordpress contact-form-7

5
推荐指数
1
解决办法
2万
查看次数

css动画旋转和翻译不能一起工作

我正在尝试使用 @keyframes 的 css 动画,但是 css Transform rotate 和 translate 属性不能一起工作。

请告知这里出了什么问题。谢谢!!

您可以在 codepen 上查看代码:http ://codepen.io/anon/pen/XdzwZB

以下是我的@keyframes 代码:

@keyframes slideIn {
  0%, 100% {
    transform: translate(10px);
    transform: rotate(0deg);
    color: red;
  }
  25% {
    transform: translate(125px);
    transform: rotate(360deg);
    color: green;
  }
}
Run Code Online (Sandbox Code Playgroud)

html css css-transforms css-animations

3
推荐指数
1
解决办法
5985
查看次数

无法从前端解析 docker compose 服务名称

您好,我是使用 docker 进行开发的新手。我试图在这里从前端(react)到后端(express.js)进行通信。

net::ERR_NAME_NOT_RESOLVED我也启用了 cors,当尝试使用 url 从后端获取时,出现错误http://backend:4001

但当我使用 docker 内部 IPAddress 时它就可以工作,例如:http://172.18.0.3:4001

以下是我的 docker-compose.yml 文件。

请提供有关使其正常工作的建议,谢谢。

version: "3"

services:

  backend:
    build: ./api
    volumes:
      - ./api:/usr/src/api
    ports:
      - 6002:4001
    depends_on:
      - database

  database:
    image: mongo:4.0.15-xenial
    ports:
      - 27018:27017


  frontend:
    build: ./app
    volumes:
      - ./app:/usr/src/app
    ports:
      - 6001:3000
    links:
      - backend
    depends_on:
      - backend
Run Code Online (Sandbox Code Playgroud)

docker dockerfile docker-compose docker-network

3
推荐指数
1
解决办法
1505
查看次数