We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import { observable, computed, autorun, action } from 'mobx' class HostUser { @observable defaultVal = 'abc' } export default new HostUser()
import React from 'react' import Nav from './Nav' import {observer} from 'mobx-react' import HostUser from '../model/index' @observer export default class Users extends React.Component { constructor(props){ super(props) console.log(props) this.state = { a:'个人' } } render() { console.log(this) return ( <div className='page page-current'> <header className='bar bar-nav'> <h1 className='title'>{this.state.a}</h1> </header> <Nav item={ 2 }/> <div className='content'> <h1 style={{ textAlign: 'center' }}>个人</h1> </div> </div> ) } }
BabelLoaderError: SyntaxError: C:/Users/Administrator/Desktop/ReactMobx/app/module/model/index.js: Unexpected token (4:25) 2 | 3 | class HostUser { > 4 | @observable defaultVal = 'abc' | ^ 5 | } 6 | 7 | export default new HostUser()
The text was updated successfully, but these errors were encountered:
是否安装了babel-plugin-transform-decorators-legacy?
Sorry, something went wrong.
这个依赖安装了,有没有可能是其他的问题呢?
和楼主一样的问题, @observable state = { number:0 } 等号那里报错。
No branches or pull requests
The text was updated successfully, but these errors were encountered: