feat(view): 商品列表新增商品自定义卡片模板三形态示例

This commit is contained in:
augushong
2026-09-25 10:37:49 +00:00
parent 53ee2e3c40
commit 58053e0280
2 changed files with 197 additions and 1 deletions

View File

@@ -4,6 +4,13 @@ $(function () {
ua.table.render({
init: init,
totalRow: true,
// 多形态视图:table + 商品卡(Vue 自定义模板)+ 内置 card 三形态,
// 参照用户管理页官方示例(system/admin)。tplVueId 指向 index.html 中的
// <script type="text/x-template" id="goodscardTpl"> 节点(须位于渲染容器
// 之外),模板上下文契约见该节点处注释。layoutList 条目 >1 时工具栏自动
// 出现"视图"切换按钮;受控是默认数据流,controlled 缺省即受控,视图切换
// 经 store 当页数据完成,零网络请求。
layoutList: ['table', {name: 'goodscard', title: '商品', tplVueId: '#goodscardTpl'}, 'card'],
cols: [[
{ type: "checkbox" },
{ field: 'id', width: 80, title: 'ID', totalRowText: '合计:' },