Permalink
Browse files

feat(form): Swith to functional component (#865)

* [form] functional component

* switch to FC
  • Loading branch information...
tmorehouse committed Aug 16, 2017
1 parent 00e2b6f commit c9f054dcd87fce9203ee09cec851da382e5250d8
Showing with 42 additions and 1 deletion.
  1. +41 −0 lib/components/form.js
  2. +1 −1 lib/components/index.js
@@ -0,0 +1,41 @@
import { mergeData } from "../utils";
export const props = {
id: {
type: String,
default: null
},
inline: {
type: Boolean,
default: false
},
novalidate: {
type: Boolean,
default: false
},
validated: {
type: Boolean,
default: false
}
};
export default {
functional: true,
props,
render(h, { props, data, children }) {
return h(
"form",
mergeData(data, {
class: {
"form-inline": props.inline,
"was-validated": props.validated
},
attrs: {
id: props.id || null,
novalidate: props.novalidate
}
}),
children
);
}
};
@@ -23,7 +23,7 @@ import bDropdownItem from "./dropdown-item";
import bDropdownItemButton from "./dropdown-item-button";
import bDropdownDivider from "./dropdown-divider";
import bDropdownHeader from "./dropdown-header";
import bForm from "./form.vue";
import bForm from "./form";
import bFormRow from "./form-row";
import bFormText from "./form-text";
import bFormFeedback from "./form-feedback";

0 comments on commit c9f054d

Please sign in to comment.