Skip to content
This repository was archived by the owner on Jun 10, 2021. It is now read-only.

Commit d96e946

Browse files
committed
Now the render support JSX, fixed spaces between spaces
1 parent 450e7af commit d96e946

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/components/ServerDatasource.vue

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
import DatasourceUtils from '../utils/DatasourceUtils'
33
import Pagination from './Pagination.vue'
4-
import { EventBus } from '../utils/EventBus'
4+
import {EventBus} from '../utils/EventBus'
55
export default {
66
name: 'ServerDatasource',
77
components: {Pagination},
@@ -12,13 +12,13 @@ export default {
1212
<div class="panel-heading">
1313
<div class="form-inline">
1414
<div class="form-group pull-left">
15-
<label class="control-label pr2">{ this.translation.limit }</label>
16-
<select on-change={ (e) => this.sync('perpage', parseInt(e.target.value)) } class="form-control" number>
17-
{ this.limitOptions }
15+
<label class="control-label pr2">{this.translation.limit}</label>
16+
<select on-change={(e) => this.sync('perpage', parseInt(e.target.value))} class="form-control" number>
17+
{this.limitOptions}
1818
</select>
1919
</div>
2020
<div class="form-group pull-right">
21-
<input class="form-control mr1" type="text" on-input={ (e) => this.searching(e) } placeholder={this.translation.placeholder_search} />
21+
<input class="form-control mr1" type="text" on-input={(e) => this.searching(e)} placeholder={this.translation.placeholder_search} />
2222
</div>
2323
<div class="clearfix"></div>
2424
</div>
@@ -27,23 +27,23 @@ export default {
2727
<table class="table table-striped">
2828
<thead>
2929
<tr>
30-
{ this.columnItems }
30+
{this.columnItems}
3131
</tr>
3232
</thead>
3333
<tbody>
34-
{ this.columnObjects }
34+
{this.columnObjects}
3535
<tr>
36-
<td class="text-center warning" colspan={ this.columns.length }>{ this.tableInfo }</td>
36+
<td class="text-center warning" colspan={this.columns.length}>{this.tableInfo}</td>
3737
</tr>
3838
</tbody>
3939
</table>
4040
</div>
4141
<div class="panel-footer">
4242
<div class="pull-left btn-group btn-group-actions">
43-
{ this.actionsObject }
43+
{this.actionsObject}
4444
</div>
4545
<div class="pull-right">
46-
<pagination pages={ this.pagination }></pagination>
46+
<pagination pages={this.pagination}></pagination>
4747
</div>
4848
<div class="clearfix"></div>
4949
</div>
@@ -131,35 +131,35 @@ export default {
131131
computed: {
132132
limitOptions () {
133133
return this.limits.map((limit, index) => {
134-
return <option value={ limit } selected={ parseInt(this.perpage) === parseInt(limit) }>{ limit }</option>
134+
return <option value={limit} selected={parseInt(this.perpage) === parseInt(limit)}>{limit}</option>
135135
})
136136
},
137137
columnItems () {
138138
return this.columns.map((column, index) => {
139-
return <th>{ column.name }</th>
139+
return <th>{column.name}</th>
140140
})
141141
},
142142
columnObjects () {
143143
if (this.source.length === 0) {
144144
return <tr class="text-center">
145-
<td colspan={ this.columns.length }>{ this.translation.records_not_found }</td>
145+
<td colspan={this.columns.length}>{this.translation.records_not_found}</td>
146146
</tr>
147147
} else {
148148
return this.source.map((row, index) => {
149149
let columns = this.columns.map((column, index) => {
150-
return <td domPropsInnerHTML={ this.fetchFromObject(row, column.key, column.render) }></td>
150+
return <td>{this.fetchFromObject(row, column.key, column.render)}</td>
151151
})
152-
return <tr class={{ success: index === this.indexSelected }} on-click={ (e) => this.selectRow(e, row, index) }>{ columns }</tr>
152+
return <tr class={{success: index === this.indexSelected}} on-click={(e) => this.selectRow(e, row, index)}>{columns}</tr>
153153
})
154154
}
155155
},
156156
actionsObject () {
157157
return this.actions.map((action, index) => {
158158
try {
159159
if (action.show(this.selected)) {
160-
return <button class={this.dynamicClass('btn', action.class)} type="button" on-click={ (e) => action.event(e, this.selected) }>
161-
<i class={ this.dynamicClass('pr1', action.icon) }></i>
162-
{ action.text }
160+
return <button class={this.dynamicClass('btn', action.class)} type="button" on-click={(e) => action.event(e, this.selected)}>
161+
<i class={this.dynamicClass('pr1', action.icon)}></i>
162+
{action.text}
163163
</button>
164164
}
165165
} catch (ex) {

0 commit comments

Comments
 (0)