您好,我试图让 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) 嗨,我想在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) 我正在尝试使用 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,其效果就像使其始终为真。
嗨,我是联系表格 7 的新手。我在 Youtube 教程中看到过,联系表格 7 提交时无需刷新页面。但是当我安装插件时,它会刷新页面。
请告知如何使其在不刷新页面的情况下工作。谢谢。
我正在尝试使用 @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) 您好,我是使用 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) typescript ×2
angular ×1
css ×1
docker ×1
dockerfile ×1
html ×1
lua ×1
neovim ×1
reactjs ×1
redux ×1
vim-plugin ×1
wordpress ×1