我有一个名为this.props
contains 的对象
{
actions: Object,
dirty: false,
form: "Statement",
autofill: functon(),
**statement: Object**
}
Run Code Online (Sandbox Code Playgroud)
statement
包含
{
firstName: "John"
lastName: "Peter"
isConfirmed: true
}
Run Code Online (Sandbox Code Playgroud)
我想使用es6解构在同一行中提取statement
对象和isConfirmed
属性
我试过了
const { statement: isConfirmed, isAdmin } = this.props
Run Code Online (Sandbox Code Playgroud)
当我这样做时,我得到了一个错误 let a = isConfirmed, b = statement
我有一个角度应用程序:https : //github.com/XBITSwitzerland/ngx-admin/tree/ng2-admin
现在我尝试做: npm install
但是我遇到了这个错误(命令的竞赛输出太长了,因此我在这里仅分享最后一部分):
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\github\ngx-admin\node_modules\node-gyp\lib\build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\github\\ngx-admin\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd C:\github\ngx-admin\node_modules\wintersmith-sassy\node_modules\node-sass
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
Build failed with …
Run Code Online (Sandbox Code Playgroud) 我正在尝试在 React 中使用 ALERTIFYJS,但它的 alertify 警报不起作用。下面是代码
(window.alert 在我的浏览器上运行良好)
import alertify from 'alertifyjs';
clickHandle = () => {
alertify.alert('Alert Title', 'Alert Message!', function(){
alertify.success('Ok');
});
}
Run Code Online (Sandbox Code Playgroud) 在我的代码中,我在卸载组件时遇到问题。我正在使用抽屉导航器,当我在抽屉屏幕之间导航时,前一个屏幕并没有消失,当我再次打开该屏幕时,一切都还在那里。
但当我在抽屉屏幕之间导航时,我想重新渲染或卸载并再次安装组件。有办法吗?或者我如何手动卸载我的组件?我知道对此有很多疑问,但我找不到我想要的。
我的 React Native 版本是 0.63
javascript ×3
reactjs ×2
alert ×1
alertify ×1
angular ×1
ecmascript-6 ×1
node-sass ×1
node.js ×1
npm ×1
npm-install ×1
react-native ×1