Handle constructor
Closed this issue ยท 0 comments
egoist commented
class App extends Component {
constructor(props) {
super(props)
const bar = 'bar'
this.state = { foo: props.foo + bar }
this.something = bar
}
}Maybe transform to this? not sure ๐
const App = {
data() {
var props = this.$props
const bar = 'bar'
return { foo: props.foo + bar }
},
created() {
const bar = 'bar'
this.something = bar
}
}Or:
const App = {
data() {
var props = this.$props
const bar = 'bar'
var __state = { foo: props.foo + bar }
this.something = bar
return __state
}
}