1.文件预览
原本的elmType
属性新增一个filepreview
,并在attribute
属性中添加值为@thumbnail.Size
.
Demo:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "filepreview",
"attributes": {
"src": "@thumbnail.medium"
},
"style": {
"display": "block",
"margin": "0 auto",
"max-height": "100px"
},
"customCardProps": {
"openOnEvent": "hover",
"isBeakVisible": true,
"formatter": {
"elmType": "img",
"attributes": {
"src": "@thumbnail.200x400"
},
"style": {
"max-height": "400px"
}
}
}
}
调整List按钮顺序或隐藏或改变图标
在view formatting中新增commandBarProps属性,可以对对command bar按钮进行自定义修改。
所有支持的按钮:
'new'
'newFolder'
'newWordDocument'
'newExcelWorkbook'
'newPowerPointPresentation'
'newOneNoteNotebook'
'newFormsForExcel'
'newVisioDrawing'
'upload'
'uploadFile'
'uploadFolder'
'open'
'share'
'copyLink'
'download'
'rename'
'copyTo'
'moveTo'
'delete'
'edit'
'comment'
'editNewMenu'
'powerBI'
'powerBIVisualizeList'
'automate'
'automateCreateRule'
'automateManageRules'
'powerAutomate'
'powerAutomateCreateFlow'
'powerAutomateSeeFlows'
'powerAutomateConfigureFlows'
'aiBuilderCreate'
'aiBuilderGoto'
'aiBuilder'
'alertMe'
'newLink'
'integrate'
'manageAlert'
'powerApps'
'powerAppsCreateApp'
'powerAppsSeeAllApps'
'powerAppsCustomizeForms'
'viewDocumentUnderstandingModels'
'versionHistory'
'openInImmersiveReader'
'classifyAndExtract'
'checkOut'
'checkIn'
'undoCheckOut'
'properties'
'pinItem'
'exportExcel'
'exportCSV'
'export'
'editInGridView'
'sync'
'uploadTemplate'
'addTemplate'
'openInOfficeOnline'
'openInOfficeClient'
'addShortcut'
'pinToQuickAccess'
'unpinFromQuickAccess'
Demo
key即需要修改的按钮;postion即排在第几个,用来修改按钮顺序;sectionType表示放在第一排(primary)还是放到ellipsis按钮下(overflow)
{
"commandBarProps" : {
"commands": [
{
"key": "new",
"position": 2
},
{
"key": "share",
"position": 1,
"sectionType": "Overflow"
},
{
"key": "alertMe",
"position": 3,
"sectionType": "Primary"
}
]
}
}
new按钮放到第二个,alertme按钮放到第三个,share按钮放到ellipsis按钮下第一个
文档地址:https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-commandbar-formatting