Git Product home page Git Product logo

modal's Introduction

vue-bulma

A modern UI framework based on Vue and Bulma.

Install

Install with npm:

$ npm i vue-bulma --save

Install with yarn:

$ yarn add vue-bulma

Example

import Vue from 'vue'
import * as components from 'vue-bulma'

// In the global registration
for (const [key, value] of Object.entries(components)) {
  const name = value.name || `vb-${key.toLowerCase()}`
  Vue.component(name, value)
}

Development

We use Lerna to manage multiple packages.

$ npm i lerna --global 
$ yarn bootstrap

Open Examples

$ yarn dev

Format packages

$ yarn run format

Create a package

# vue-bulma-container
$ lerna create vue-bulma-container
$ lerna add vue packages/vue-bulma-container/
$ lerna add bulma packages/vue-bulma-container/
$ cd packages/vue-bulma-container/
$ mkdir src
$ touch src/main.js
$ touch src/style.scss

Add to vue-bulma

$ lerna add vue-bulma-container packages/vue-bulma/

Team

Lead Maintainers

Collaborators

License

Licensed under MIT.

modal's People

Contributors

dasdaniel avatar fundon avatar jzelez avatar luventa avatar rush-skills avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

modal's Issues

Maybe modal can pass a partial template as modal body.

正文用中文好了
有些情况下,modal body里面的内容可能是需要预编译的 vue 模板,这时候如果能支持传入一个 partial 作为 modal body 可用性就更高了

这只是一个简单可用的commit,因为我只用到了 card modal,就不发 PR 了。建议对整个 modal 组件做一个可复用的变更。
BelinChung@88ad34a

Can't resolve Modal, CardModal and ImageModal

I got "Error in ./~/vue-bulma-modal/src/index.js Module not found: Error: Can't resolve './Modal'"

same for CardModal and ImageModal

i added the file extensions, and it works now. I'm not sure why these would be required in my project. I used vue cli to generate project and added components as needed.

import Modal from './Modal.vue'
import BaseModal from './BaseModal.js'
import CardModal from './CardModal.vue'
import ImageModal from './ImageModal.vue'

Open event for modal not sent?

Hello. I am trying to handle data passed to modal but it looks like open event does not received in my handler

mounted () {
      this.$on('open', () => {
         // Not executed
      })
      this.$on('opened', () => {
        // Not executed
      })

      this.$on('close', () => {
        // Executed!
      })
},

...
"vue-bulma-modal": "1.0.1",
...

Need documentation

Hello,

Thank you for this component, but that would be really useful to add a tiny documentation.

I've just spend 2 hours trying to make this component works.
I've created a custom component, and imported vue-bulma-modal, then instantiate this component with Vue but I still can't figure out how I can trigger any modal methods (which are ?) from my webpage.
Can I achieve this from my component ? Am I supposed to use Vuex ?

Please consider a basic documentation.

Thanks

Modal flickering

Hi, when I open the modal the transition between .modal <-> .is-active leads to flicker effect.
I have to set also the enter class to avoid this issue. Do you have an idea why this is necessary? I try it like in the example. In vue-admin you create the modal in a different way.

:enter-class="enterClass"

Data must be a string or a buffer

I'm using vue-bulma in an Electron app, and everything went OK until I had to include modals...

In my JS :
import { CardModal } from 'vue-bulma-modal'

In my HTML:

<card-modal :visible="false" :title="Some lazy title" transition="zoom">
...
</card-modal>

causes :

> cross-env NODE_ENV=production webpack --progress --hide-modules

 86% hashingcrypto.js:74
  this._handle.update(data, encoding);
               ^

TypeError: Data must be a string or a buffer
    at TypeError (native)
    at Hash.update (crypto.js:74:16)

When I remove the import, webpack succeed to compile my app.

Someone got an idea ?
Thanks.

Failed to compile on 'npm run production'

I am using laravel-mix and Webpack.

public/js/app.js from UglifyJs
Unexpected token punc «(», expected punc «:» [./~/vue-bulma-modal/src/BaseModal.js:14,0][public/js/app.js:656,7]

Issues with Deactive and active methods

The prop visible won't function properly once the deactive method has been called

Steps to reproduce

<button @click="() => modalVisible = true">open modal</button>

<card-modal :visible="modalVisible" @cancel="() => modalVisible = false"> sdklfjsda </card-modal>

data() { return { modalVisible: false }

This would work only when you click the button and the cancel button. When you click the close button the deactive method in the BaseModal Mixin is called, and all it does is set the show to false.
Since the show and the modalVisible are meant to be in sync, the next time you click on the button modalVisible would remain true but show would be false.

if I change the click function of the button to toggle the state of modalVisible, I would have to click 2 times to get the modal back to visible.

The temporary fix is adding ref to the modal

<button @click="() => $refs.modal.active()">open modal</button>

<card-modal ref="modal" :visible="modalVisible" @cancel="() =>$refs.modal.deactive()"> sdklfjsda </card-modal>

Which makes the :visible prop somewhat useless.

Component wont transpile during build

the shortand functions inside the .js file imported as a mixin (BaseModal.js):

es. data()

wont be transpiled ( in data: function()) when i build the app with webpack

this gives error on ie 11 or lower

:closable="true" ignored for background

In the template(s) you have this
<div class="modal-background" @click="deactive"></div>

and this
<button class="modal-close" @click="deactive" v-if="closable"></button>

both actions point to

deactive () {
   this.show = false
}

so while the button may be hidden, the action of the background would still fire

please look at pull review for suggestion to fix
#8

[FEATURE REQUEST] slot for footer in CardModal

it would be very useful to have a slot for the footer in the card modal, because sometimes i do not need the two buttons and sometimes i even need more buttons or something else but the footer is not configurable.

A simple slot would be easy to implement and therefore, the events emited for these buttons won't be needed anymore, as it would be handled by the wya this slot would be use

Laravel Elixir issue?

I'm using Laravel Elixir 6.0.0-15 and get the following error

ERROR in ./~/vue-bulma-modal/src/index.js
Module not found: Error: Can't resolve './Modal' in 'I:\Lavarel\onsen\node_modules\vue-bulma-modal\src'
 @ ./~/vue-bulma-modal/src/index.js 1:0-27

If I make the following changes to the index.js file, it functions

import Modal from './Modal.vue'
import BaseModal from './BaseModal.js'
import CardModal from './CardModal.vue'
import ImageModal from './ImageModal.vue'

I realize that Laravel Elixir has been superseded by Mix now and it may work from there but I haven't tested it.

modal with id

assume there are many modals in the same page ... how could i target a specific modal by id ???
any help please

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.