我坚持用redux连接器导出material-ui样式.这是我的代码:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import Drawer from 'material-ui/Drawer';
import { withStyles } from 'material-ui/styles';
import PropTypes from 'prop-types';
const mapStateToProps = state => ({});
const reduxConnector = connect(mapStateToProps, null);
const styles = theme => {
console.log(theme);
return ({
paper: {
top: '80px',
boxShadow: theme.shadows[9]
},
});
};
class Cart extends Component {
render() {
const { classes } = this.props;
return (
<Drawer
open
docked
anchor="right"
classes={{ paper: classes.paper }} …Run Code Online (Sandbox Code Playgroud) 我安装了虚拟盒子.当我查看主机> LAN> IP地址是exp://192.168.56.1:19000.
如何在不禁用网络的情况下更改它?因为这是我的虚拟机ip,我的设备无法连接到它.
谢谢
我试图删除我安装的最后一个包,让我的凉亭这样.但仍然没有运气.
看起来当我安装我的最后一个包时,我错误地粘贴了一个制表符:
bower install angular-input-stars-directive
Run Code Online (Sandbox Code Playgroud)
现在,每当我更新它时,即使在我的其他项目中也总是会返回此错误:
bower invalid-meta"名称"建议为小写,可以包含数字,点,短划线
我已经尝试bower cache clean并重新安装了凉亭,但仍然没有运气.
有没有什么办法解决这一问题?
这是我的代码:
store.js
import {createStore, applyMiddleware, compose} from 'redux';
import {fromJS} from 'immutable';
import {routerMiddleware} from 'react-router-redux';
import createSagaMiddleware from 'redux-saga';
import createReducer from './reducers';
const sagaMiddleware = createSagaMiddleware();
export default function configureStore(initialState = {}, history) {
// Create the store with two middlewares
// 1. sagaMiddleware: Makes redux-sagas work
// 2. routerMiddleware: Syncs the location/URL path to the state
const middlewares = [sagaMiddleware, routerMiddleware(history)];
const enhancers = [applyMiddleware(...middlewares)];
const store = createStore(createReducer, fromJS(initialState), enhancers);
// Extensions
store.runSaga = sagaMiddleware.run;
store.asyncReducers …Run Code Online (Sandbox Code Playgroud) 在laravel 5上使用查询构建器获取更新问题.我已尝试禁用updated_at但仍然失败.
这是我的代码:
$query = StockLog::where('stock_id', $id)->whereBetween('created_at', $from, $to])->update(['batch_id' => $max + 1]);
Run Code Online (Sandbox Code Playgroud)
我尝试了两种方法:第一种在我的模型中设置:
public function setUpdatedAtAttribute($value)
{
/*do nothing*/
}
Run Code Online (Sandbox Code Playgroud)
第二个:
$stocklog = new StockLog;
$stocklog->timestamps = false;
$query = $stocklog::where('stock_id', $id)->whereBetween('created_at', [$from, $to])->update([
'batch_id' => $max + 1]);
Run Code Online (Sandbox Code Playgroud)
他们俩都失败了.无论如何要禁用updated_at?
提前致谢
我想问一下Laravel的最佳实践.
我使用gulp为我的js和css.我应该在资产文件夹中使用哪一个(在服务器上使用"gulp")或公共文件夹(gulp结果)?
我的所有查询都有一个问题,varcharID返回一个整数.
例如,应该返回的查询C-1451963448-MjL返回0.
我的查询:
$transaction = Transaction::with('user')->get();
return response()->json($transaction);
Run Code Online (Sandbox Code Playgroud)
返回:
[
{
"id": 0,
"user_id": 8,
"amount": "56164.00",
"created_at": "2016-01-05 10:10:48",
"user": {
"id": 8,
"facebook_id": null,
"first_name": "Alta",
"last_name": "Keebler",
}
},
]
Run Code Online (Sandbox Code Playgroud)
事务ID变为0.上次我尝试成功,但现在每个ID都varchar返回0而不是实际值.
我试过foreach了get查询,是的,id是0.我也试过,dd($transaction)当我检查它,它返回我正确的ID.
我该怎么办才能让它再次发挥作用?
我想更改我的应用程序图标。我试过改变它,但应用程序图标(已经添加到主屏幕或安装在应用程序抽屉上)没有改变。
这是我的 manifest.json
{
"short_name": "React App",
"name": "Create React App Sample",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "react.png",
"sizes": "144x144",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
Run Code Online (Sandbox Code Playgroud)
我已经更改了 144x144 大小的名称和图标,但什么也没发生。
用户添加到主屏幕后,我可以更改应用程序图标吗?
我读过Tip: Icons may be cached, so it may be helpful to change the filenames when updating icons or other graphics.
但等了 24 小时,图标直到现在才改变。
我尝试使用react和webpack实现wow.js.
我通过npm安装它.
npm install --save wow.js
它完美安装.现在的问题是如何正确导入它.我不能让它工作继续未定义.
我尝试过几点:
第一:
import wow from 'wow.js';
Run Code Online (Sandbox Code Playgroud)
但是webpack无法编译它.它说无法找到该模块.即使我使用完整的网址import wow from /node_modules/wow.js
第二:
我在这里使用这个解决方案:
require('imports?this=>window!js/wow.js');
Run Code Online (Sandbox Code Playgroud)
但我仍然找不到模块(我改变了我的node_modules的路径).
第三:
从这里:
我正在使用expose模块并试着new WOW().init();说Wow is undefined.
我没有使用他的第一个解决方案因为我希望我的html看起来很简单只有bundle.js脚本.
我找不到任何其他解决方案.我该怎么做才能让它发挥作用?
谢谢!
我的webpack.config.js:
module.exports = {
entry: [
'webpack-dev-server/client?http://localhost:8080',
'bootstrap-loader',
'webpack/hot/only-dev-server',
'./src/js/index.js'
],
output: {
path: __dirname + "/build",
publicPath: "/build/",
filename: 'bundle.js'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
"window.jQuery": "jquery"
})
],
module: …Run Code Online (Sandbox Code Playgroud) <Formik
isInitialValid
initialValues={{ first_name: 'Test', email: 'test@mail.com' }}
validate={validate}
ref={node => (this.form = node)}
onSubmitCallback={this.onSubmitCallback}
render={formProps => {
const fieldProps = { formProps, margin: 'normal', fullWidth: true, };
const {values} = formProps;
return (
<Fragment>
<form noValidate>
<TextField
{...fieldProps}
required
autoFocus
value={values.first_name}
type="text"
name="first_name"
/>
<TextField
{...fieldProps}
name="last_name"
type="text"
/>
<TextField
{...fieldProps}
required
name="email"
type="email"
value={values.email}
/>
</form>
<Button onClick={this.onClick}>Login</Button>
</Fragment>
);
}}
/>
Run Code Online (Sandbox Code Playgroud)
我正在尝试此解决方案https://github.com/jaredpalmer/formik/issues/73#issuecomment-317169770但它总是让我返回Uncaught TypeError: _this.props.onSubmit is not a function
当我尝试console.log(this.form)有submitForm功能。 …
reactjs ×5
laravel ×3
javascript ×2
php ×2
bower ×1
expo ×1
formik ×1
git ×1
laravel-4 ×1
laravel-5 ×1
material-ui ×1
react-native ×1
react-redux ×1
redux ×1
redux-saga ×1
webpack ×1