New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

b-table :fields converts <th>'s to a-z #1142

Closed
tarreislam opened this Issue Oct 2, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@tarreislam

tarreislam commented Oct 2, 2017

Hello!

I noticed that if you use the custom :fields="data" binding on the <b-table> tag, the "special chars" are stripped, is that done for any special reason?

Example:

<script>
  export default {
    name: 'contacts',
    data: function () {
      return {
        contacts: {
          fields: ['teståäöèò'], /// testaaoeo
          items: [{...}]
        }
      }
    }
  }
</script>

/Tarre

@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Oct 3, 2017

It appears that lodash.startcase converts all special chars to their base letter: lodash/lodash#3242

_.startcase is used to normalize the field names (converting kebab-case, camelCase, etc, into more "human" friendly labels.

They are expecting release v5 of lodash/startcase to fix this issue.

@tarreislam

This comment has been minimized.

tarreislam commented Oct 5, 2017

Okay, then ill wait, thanks.

@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Oct 5, 2017

We might be able to make a work-around in b-table, where startcase is only used if no explicit label is given in the fields definition.

@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Oct 6, 2017

Actually, if you use the longer form field definition, you can avoid the startcase conversion:

<script>
  export default {
    name: 'contacts',
    data: function () {
      return {
        contacts: {
          fields: [{ key: 'teståäöèò', label: 'teståäöèò' ], // Array of objects
          // or
          fields: { 'teståäöèò': { label: 'teståäöèò'} }, // Object of objects
          items: [{...}]
        }
      }
    }
  }
</script>
@tarreislam

This comment has been minimized.

tarreislam commented Oct 6, 2017

Thanks for the help.

@tmorehouse tmorehouse closed this Nov 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment