Giter VIP home page Giter VIP logo

vue-mountable's Introduction

Hi there ๐Ÿ‘‹

โ€ข Founder of Nophase Studio
โ€ข Full Stack Developer
โ€ข Laravel x Vue x Vite
โ€ข Passionate Gamer
โ€ข Nerd for Life
โ€ข Proud Owner of two Kittens

vue-mountable's People

Contributors

subwaytime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vue-mountable's Issues

Roadmap 2.0

Roadmap

  • Host Documentation & Example
  • Implement Example into Documentation
  • Fix some API Reference in Documentation (there is just some tiny parts missing)

planned for 0.1.2 (probably for next week)

Props not reactive

To reproduce

        const props = { visible: true }
        mountComponent(MyModal, { props })
        setTimeout(() => { props.visible = false }, 1000)

Expected

Visible should be set to false and watcher in myMyModal should notice it.

What happens

MyModal remains unchanged.

Support multiple Fragments

At the moment it is required to have only one tag in the mounted component, otherwise these errors will appear.

image

--> Solution:
This is basically the same approach as before 0.1 - adding inheritAttrs: false to each mounted component. However it was removed due to the fact that attributes then, including props etc are automatically removed, which might be not ideal.

It should automatically check if a component contains multiple fragments and then apply inheritAttrs: false, this should align with vue 3

Roadmap

Roadmap

  • Devtools Support
  • Allow resolveComponent and resolveDynamicComponent
  • Allow defineComponent and defineAsyncComponent
  • Allow HTML Tags to get mounted directly (this should make things easier then having to use a vue component every single time)
  • Add native Vue Transitions
  • Remove teleported DOM Message after destroying an Element (it just gets messy after multiple mounting usages)
  • Multi Instance Support
  • CDN Support (script tag)
  • Better Typing (to many any's)

Let me know if there are other Features that would work well with this Library!

CDN / global build

As far as I can tell, there isn't currently a build of this library that can be used directly from a CDN via a <script> tag.

Even though such builds aren't typically used in production, they are very commonly used when asking questions (Discord, SO, etc.) and for reporting issues on GitHub.

Can't be used in composables/outside setup

Current big Issue is that calling the useComponent like this:

> useDialog.js
import { useComponent } from 'vue-mountable';

export function useDialog() {
	const { mount, destroy } = useComponent();

	const component = mount(dialog);
}

> app.vue
<script setup>
function test() {
    useDialog() // error
}
</script>

wont work as there is no vue instance, while calling it inside setup() or script setup will work like it should.

Add support for multiple apps

service.ts shares container, node and instance between usages. This causes problems if the plugin is installed on multiple apps. e.g.:

import { createApp } from 'vue'
import { VueMountable } from 'vue-mountable'
import App from './App.vue'

const app = createApp(App)
app.use(VueMountable)
app.provide('msg', 'app1')
app.mount('#app')

const app2 = createApp(App)
app2.use(VueMountable)
app2.provide('msg', 'app2')
app2.mount('#app2')

The functions provided by useComponent will then be bound to the second app in both cases. So, for example, attempting to inject the msg from inside a component mounted by VueMountable will always show app2, irrespective of which app it is in.

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.