diff --git a/CHANGELOG.md b/CHANGELOG.md index 86f093998..f13f84ea4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Buefy Changelog +## 0.3.2 + +* Modal can be used in template as well (non programmatic) + ## 0.3.1 * Field ``grouped`` now also works on nested Fields diff --git a/docs/pages/documentation/general/Modal.vue b/docs/pages/documentation/general/Modal.vue index a92f631d4..021a10e18 100644 --- a/docs/pages/documentation/general/Modal.vue +++ b/docs/pages/documentation/general/Modal.vue @@ -1,28 +1,90 @@ + +

Events

+ + + @@ -55,9 +132,22 @@ export default { data() { return { - email: 'evan@you.com', - password: 'testing', + ModalForm, + isImageModalActive: false, + isCardModalActive: false, + isComponentModalActive: false, + formProps: { + email: 'evan@you.com', + password: 'testing' + }, props: [ + { + name: 'active', + description: 'Whether modal is active or not, use the .sync modifier to make it two-way binding', + type: 'Boolean', + values: '—', + default: 'false' + }, { name: 'component', description: `Component to be shown. Close Modal programatically by emitting a 'close' event — this.$emit('close') — from the component`, @@ -67,7 +157,7 @@ }, { name: 'props', - description: 'Props to be binded to the component', + description: 'Props to be binded to the injected component', type: 'Object', values: '—', default: '—' @@ -101,7 +191,79 @@ default: '—' } ], - code1: ` + events: [ + { + name: 'close', + description: 'Triggers when user closed/canceled or called programmatically from the injected component', + parameters: '—' + } + ], + template1: ` + + + + +

+ +

+
+ + +
+
+
+ Image +
+
+
+
+
+
+ Image +
+
+
+

John Smith

+

@johnsmith

+
+
+ +
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Phasellus nec iaculis mauris. @bulmaio. + #css #responsive +
+ 11:09 PM - 1 Jan 2016 +
+
+
+
+ `, + template2: ` + + + + `, + code2: ` + import ModalForm from './components/ModalForm' + + export default { + data() { + return { + ModalForm, + isComponentModalActive: false, + formProps: { + email: 'evan@you.com', + password: 'testing' + } + } + } + }`, + code3: ` export default { methods: { imageModal() { @@ -117,28 +279,28 @@ content: \`
- Image + Image
-
-
- Image -
-
-
-

John Smith

-

@johnsmith

-
+
+
+ Image +
+
+
+

John Smith

+

@johnsmith

+
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. - Phasellus nec iaculis mauris. @bulmaio. - #css #responsive -
- 11:09 PM - 1 Jan 2016 + Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Phasellus nec iaculis mauris. @bulmaio. + #css #responsive +
+ 11:09 PM - 1 Jan 2016
\` @@ -146,24 +308,18 @@ } } }`, - code2: ` + code4: ` import ModalForm from './components/ModalForm' export default { - data() { - return { - email: 'evan@you.com', - password: 'testing' - } - }, methods: { componentModal() { this.$modal.open({ component: ModalForm, width: 380, props: { - email: this.email, - password: this.password + email: 'evan@you.com', + password: 'testing' } }) } @@ -227,8 +383,8 @@ component: ModalForm, width: 380, props: { - email: this.email, - password: this.password + email: 'evan@you.com', + password: 'testing' } }) }, diff --git a/src/components/modal/Modal.vue b/src/components/modal/Modal.vue index b971cbed5..a966c7ffc 100644 --- a/src/components/modal/Modal.vue +++ b/src/components/modal/Modal.vue @@ -9,7 +9,8 @@ :is="component" @close="close"> -
+
+ @@ -18,9 +19,12 @@