<script>
export default {
  name: 'SdSortChildren',
  functional: true,
  inheritAttrs: false,
  render(createElement, context) {
    return context.children.sort((a, b) => {
      return (
        (a.data.attrs['data-order'] || Number.POSITIVE_INFINITY) -
        (b.data.attrs['data-order'] || Number.POSITIVE_INFINITY)
      )
    })
  },
}
</script>
