Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

laracoft's avatar

Configurable javascript library using vue

  1. I would like to write a javascript library that creates a floating action button (FAB)
  2. After using the <script> tag to load the library, It should be configurable with something like
FABWidget.init(options); // adds a floating action button to the page
  1. Can something like FABWidget be written using vue?
0 likes
1 reply
martinbean's avatar

@laracoft Yes, it could be written in Vue, but it wouldn’t then be used like your example.

If you made a Vue component then you’d put it in your page using a <floating-action-button> tag or something, passing any props to configure its appearance and behaviour (i.e. what action to perform when clicked).

Please or to participate in this conversation.