refi64 / vuedart

Create Vue web apps in Dart
https://refi64.com/vuedart
310 stars 19 forks source link

Guidelines to add more plugins #6

Closed kimond closed 7 years ago

kimond commented 7 years ago

How would you like to proceed if I would like to add support for other plugins like vuetiful.?

refi64 commented 7 years ago

I mean, it depends on the plugin. For UI frameworks like Vuetiful, it's the easiest.

Now, I can't find any good examples for Vuetiful at the moment that don't rely on webpack, so I'm flying blind a bit here...

For pretty much any Vue plugin, you would call Vue.use(Plugin). In the VueDart world, it's similar. Here would be a basic plugin:

import 'package:vue2/vue.dart';

class Vuetiful extends VuePlugin {
  static void use() => VuePlugin.use('Vuetiful'); // <-- or whatever the name is
}

So then you can put Vuetiful.use() in your main function.

If you need to bind custom methods, you can always use Dart's standard package:js interop.

Does that roughly cover it?

kimond commented 7 years ago

Perfect thank you!

refi64 commented 7 years ago

Sure! Just let me know for anything else!