Skip to content
New issue

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

el-table不展示数据 #28

Open
edroplet opened this issue Mar 16, 2024 · 1 comment
Open

el-table不展示数据 #28

edroplet opened this issue Mar 16, 2024 · 1 comment

Comments

@edroplet
Copy link

import React from 'react'
import { DatePicker, Card, Table, TableColumn } from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import { DatePicker as ReactDatePick } from "antd"
import "antd/dist/antd.css"
import moment from 'moment'
import { applyVueInReact } from 'vuereact-combined'
const VueDatePick = applyVueInReact(DatePicker)
const VueCard = applyVueInReact(Card)
const VueTable = applyVueInReact(Table)
const VueTableCloumn = applyVueInReact(TableColumn)

// const dateFormat = moment(new Date())
class demo1 extends React.Component{
constructor (props) {
super(props)
this.state = {
value1: new Date(),
}
this.onChange = this.onChange.bind(this)
}
onChange (val) {
let date
if (!val) {
date = val
} else {
date = val.toDate()
}
this.setState({
value1: date
})
}
tableData () {
return [
{
id: 1,
title: 'VueTable组件1',
}
]
}
render(){
return (


React 组件


{this.state.value1 && this.state.value1.toString()}



vue element-ui的datePicker
<VueDatePick
// 实现vue的v-model
$model={{
value: this.state.value1,
setter: (val) => {
this.setState({value1:val})
}
}}
align="right"
type="date"
placeholder="选择日期"/>








vue element-ui的Card
<VueCard class="aaa" $slots={{
header: (

vue的卡片

)
}}>

在element-ui的Card中应用react antd的DatePick

<ReactDatePick onChange={this.onChange} value={this.state.value1 && moment(this.state.value1)}/>


vue element-ui的datePicker
<VueDatePick
// 实现vue的v-model
$model={{
value: this.state.value1,
setter: (val) => {
this.setState({value1:val})
}
}}
align="right"
type="date"
placeholder="选择日期"/>




)
}
}
export default demo1

@edroplet
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant