AT-UI / at-ui

A fresh and flat UI-Kit specially for desktop application, made with ♥ by Vue.js 2.0 (DEPRECATED)
https://at.aotu.io
MIT License
2.34k stars 230 forks source link

Using native built-in type attribute names - `at-button` #23

Closed peterblazejewicz closed 6 years ago

peterblazejewicz commented 7 years ago

Hi, Just wanted to point, the type attribute of native button is a closed list: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Attributes and has a special meaning, even in a text-based browsers: https://www.cs.bu.edu/teaching/unix/lynx/

The at-button binds type property into native button property/attr. Hence the at-button of defult type:

<at-button type="primary">Primary Button</at-button>

translates to:

<button data-v-4352c070="" type="default" class="at-btn at-btn--default" data-v-a01f69b8="">
...
</button>

which seems fine, but is wrong, as default (and presumed) type is a button type while the others are custom, library specific domain language terms:

<at-button type="text">Text Button</at-button>

becomes button with:

type='text'

The text is not a correct attribute by specs.

The pick of domain specific translation for a native term seems to prevents me from using builtin native feature like using cancel or submit types of buttons to use some built-in native behaviours in the browsers.

Let me know if you want a help with this,

Thanks!

peterblazejewicz commented 7 years ago

The input type has better translation from at-input type into native type: https://at-ui.github.io/at-ui/#/en/docs/input

koppthe commented 7 years ago

I agree with you. I can't use built-in native feature like submit types of button. This is a nonstandard practice.

I think that at-button should have a new prop like nativeType to handle the built-in native type.

I'll fix it today. Thanks for your detailed comment! @peterblazejewicz

koppthe commented 6 years ago

47