ElemeFE / ElemeFE/element

[Feature Request] el-table 等组件无法在nuxt中进行预渲染,绑定的数据不会渲染到html中,数据还是js。

Open
#18,787 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

### Existing Component

### Component Name
el-table

### Description
el-table 等组件无法在nuxt中进行预渲染,绑定的数据不会渲染到html中,数据还是js。

nuxt代码:






export default {
async asyncData ({ $axios, query }){
const columns1 = [
{title: 'Name',key: 'name' },
{title: 'Age', key: 'age' },
{title: 'Address', key: 'address'}
]
const data1 = [
{ name: 'John Brown', age: 18, address: 'New York No. 1 Lake Park'},
{name: 'Jim Green', age: 24,address: 'London No. 1 Lake Park'}
]
return {columns1 , data1}
}
}

渲染完毕之后页面html:

window.__NUXT__={"layout":"default","data":[{"columns1":[{"title":"Name","key":"name"},{"title":"Age","key":"age"},{"title":"Address","key":"address"}],"data1":[{"name":"John Brown","age":18,"address":"New York No. 1 Lake Park"},{"name":"Jim Green","age":24,"address":"London No. 1 Lake Park"}]}],"error":null,"serverRendered":true};

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.