Update locales/zh/pages/Content_Display/demo_table.py
Browse files
locales/zh/pages/Content_Display/demo_table.py
CHANGED
@@ -210,40 +210,28 @@ import simplestart as ss
|
|
210 |
data = {'name': ['π§π» Alice', 'π¦π» Bob', 'π¦π» Charlie'],
|
211 |
'age': [25, 30, 35],
|
212 |
'city': [':sunny: New York', ':cloud: San Francisco', ':sunny: Los Angeles'],
|
213 |
-
'health':[90,80,
|
214 |
-
|
|
|
215 |
df = pd.DataFrame(data)
|
216 |
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
-
|
227 |
|
228 |
-
module.exports = {
|
229 |
-
props:["item"],
|
230 |
|
231 |
-
data () {
|
232 |
-
return {
|
233 |
-
rating: 3
|
234 |
-
}
|
235 |
-
},
|
236 |
-
methods: {
|
237 |
-
//todo
|
238 |
-
},
|
239 |
-
mounted: function () {
|
240 |
-
this.rating = this.item.value/20
|
241 |
-
},
|
242 |
-
}
|
243 |
-
</script>
|
244 |
-
\'''
|
245 |
-
|
246 |
-
ss.table(df, custom_columns = ["city"], vue_columns = ["health"], vue_code = vuecode)
|
247 |
```
|
248 |
''')
|
249 |
|
|
|
210 |
data = {'name': ['π§π» Alice', 'π¦π» Bob', 'π¦π» Charlie'],
|
211 |
'age': [25, 30, 35],
|
212 |
'city': [':sunny: New York', ':cloud: San Francisco', ':sunny: Los Angeles'],
|
213 |
+
'health':[90,80,60]
|
214 |
+
}
|
215 |
+
|
216 |
df = pd.DataFrame(data)
|
217 |
|
218 |
+
cols = ss.columns([70,"flex:30; border-left:1px solid lightgray"], design=True, style="border:1px solid lightgray")
|
219 |
+
|
220 |
+
|
221 |
+
jscode = """
|
222 |
+
//console.log(test)
|
223 |
+
if(item.col == "city")
|
224 |
+
return md(item.value);
|
225 |
+
else{
|
226 |
+
var rating = item.value/20
|
227 |
+
return '<el-rate :model-value="' + rating + '" disabled />'
|
228 |
+
}
|
229 |
+
return res;/// "<el-tag>" + item.value + "</el-tag>";
|
230 |
+
"""
|
231 |
|
232 |
+
mytable_ex = ss.table(df, custom_fields = ["city", "health"], cell_render = jscode, border = True)
|
233 |
|
|
|
|
|
234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
```
|
236 |
''')
|
237 |
|