feat(view): 用户管理示例升级三形态并示范按端默认配置

This commit is contained in:
augushong
2026-09-14 18:40:02 +00:00
parent 250db090ab
commit 994803f155

View File

@@ -2,11 +2,16 @@ $(function () {
ua.table.render({
init: init,
// 多形态视图官方示例:table(默认首选)+ 名片(Vue 自定义模板)。
// 多形态视图官方示例:table + 名片(Vue 自定义模板)+ 内置 card 三形态,
// 并示范 layoutDefault 按端默认配置(见下方注释)。
// layoutList 条目 >1 时工具栏自动出现"视图"切换按钮;tplVueId 指向
// index.html 中的 <script type="text/x-template" id="usercardTpl">
// 节点(须位于渲染容器之外),模板上下文契约见该节点处注释。
layoutList: ['table', {name: 'usercard', title: '名片', tplVueId: '#usercardTpl'}],
// 受控是默认数据流,controlled 缺省即受控;仅依赖引擎 url 模式行为
// 的深度定制页才需显式传 controlled:false 逃生口。
layoutList: ['table', {name: 'usercard', title: '名片', tplVueId: '#usercardTpl'}, 'card'],
// 按端默认形态:对象式 {pc, mobile} 按端取值;兼容旧写法(字符串=双端同值,true=端缺省)。
layoutDefault: {pc: 'table', mobile: 'card'},
cols: [[
{ type: "checkbox" },
{ field: 'id', width: 80, title: 'ID' },