import snippets from './snippets'; export default { snippets, componentName: 'Affix', title: 'fixed nail', category: 'Navigation', props: [ { name: 'offsetBottom', title: { label: 'Bottom trigger distance', tip: 'Fires when the distance from the bottom of the window reaches the specified offset' }, propType: 'number', }, { name: 'offsetTop', title: { label: 'Top trigger distance', tip: 'Fires when the distance from the top of the window reaches the specified offset' }, propType: 'number', }, { name: 'target', title: { label: 'Get trigger element', tip: 'Set `Affix` to the element whose scroll event needs to be monitored, the value is a function that returns the corresponding DOM element', }, propType: 'func', }, { name: 'onChange', title: { label: 'Listen for status changes', tip: 'Callback function triggered when fixed state changes' }, propType: 'func', }, ], configure: { supports: { style: true, events: [ { name: 'onChange', template: "onChange(affixed,${extParams}){\n// 固定状态变更回调函数\nconsole.log('onChange', affixed);}", }, ], }, }, };