vueloader

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type VueLoader

type VueLoader struct {
	Config *VueLoaderConfig
	// contains filtered or unexported fields
}

func New

func New() (*VueLoader, error)

New creates a VueLoader instance with the default VueLoaderConfig.

func NewWithConfig added in v0.0.5

func NewWithConfig(config *VueLoaderConfig) (*VueLoader, error)

NewWithConfig creates a VueLoader instance with the provided VueLoaderConfig. If the layout cannot be loaded, a default one will be used which will fetch Vue.js from jsdelivr CDN.

func (*VueLoader) LoadVuePage

func (loader *VueLoader) LoadVuePage(w io.Writer, pageTitle string, rootComponent string)

LoadVuePage will write the final compiled page with the Vue instance and all the detected components into w io.Writer.

type VueLoaderConfig added in v0.0.5

type VueLoaderConfig struct {
	/*
		Layout is the base template for a Vue page.
		Can be provided as HTML or as a file path whose content will be loaded automatically.
	*/
	Layout string
	/*
		ComponentPath is the path where the compiler will search for Vue Single File Components.
	*/
	ComponentPath string
	/*
		CompileEveryRequest can be set to compile every time the LoadVuePage method is executed.
		Makes development easier without the need to restart the server every time you change something.
	*/
	CompileEveryRequest bool
}

VueLoaderConfig contains all the configuration properties for a VueLoader instance.

func NewConfig added in v0.0.5

func NewConfig() *VueLoaderConfig

NewConfig returns a new VueLoaderConfig instance with all the default properties assigned

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL