DOM helpers plugin for Vue.js using gaspard

Overview

Vue-gaspard

DOM helpers plugin for Vue.js using gaspard

npm version vue-gaspard size

Getting started

Installing

npm yarn bower  unpkg
npm install vue-gaspard yarn add vue-gaspard bower install vue-gaspard vue-gaspard.umd.js

Usage

In main.js:

import Vue from 'vue'
import VueGaspard from 'vue-gaspard'

Vue.use(VueGaspard)

In any of your components (e.g. examples):

import Vue from 'vue'

export default {
  mounted () {
    // Use gaspard global
    Vue.$gaspard.addClass(document.documentElement, 'container')
    // On his component instance
    this.$g.css('border', '1px dashed #eb592d')
    // On a referenced child element
    this.$g
      .find(this.$refs.childElement)
      .attr('title', 'gaspard !')
    // On a referenced child component
    this.$refs.childComponent.$g.css('border', '1px dotted #eb592d')
  }
}

Or use gaspard within a ">

<div id="app">Hello world !div>
<script src="https://unpkg.com/vue">script>
<script src="https://unpkg.com/gaspard">script>
<script src="https://unpkg.com/vue-gaspard">script>
<script>
  var app = new Vue({
    el: '#app',
    mounted () {
      this.$g.css('background-color', 'red')
    }
  })
script>

Options

You can optionally pass in some options:

Name Type Default Description
globalNamespace String $gaspard Global access name
instanceNamespace String $g Instance access name

Override defaults example:

Vue.use(VueGaspard, {
  globalNamespace: '$dom',
  instanceNamespace: '$dom'
})

API

gaspard's documentation

Contribute

# Install dependencies
cd vue-gaspard
npm install

# Build main library
npm run build

# Run demo
npm run dev

Licensing

MIT License Copyright (c) 2017 Luca Perret

You might also like...
Vue.js Plugin to facilitate Backbone integration

vue-backbone Vue.js Plugin to facilitate gradual migration from Backbone. Backbone Collections and Models can be safely integrated with Vue instances

Vue plugin for advanced click directive

Vue plugin for advanced click directive

A vue code diff display plugin, support Vue2 / Vue3

A code diff display plugin, available for Vue2 / Vue3. It is the vue3 version of vue-code-diff, refer to a lot of code, thanks here.

Simple string format plugin for vue-formly
Simple string format plugin for vue-formly

Simple string format plugin for vue-formly

Vue.js plugin for generating ICalendar (.ics) files.

vue-ics Vue.js plugin for generating ICalendar (.ics) files. Installation NPM npm install vue-ics --save Vue import Vue from 'vue' import ICS from 'v

A simple Vue 3 plugin for handling browser cookies with typescript support

A vue 3 plugin for handling browser cookies with typescript support. Load and save cookies within your Vue 3 application

Feather icons plugin for Vue.js, SSR supported.

Feather icons plugin for Vue.js, SSR supported.

Async data loading plugin for Vue.js

Async data loading plugin for Vue.js

A simple Vue.js 3 plugin for handling browser cookies

vue3-cookies A simple Vue.js 3 plugin for handling browser cookies, forked from https://github.com/cmp-cc/vue-cookies Installation Package Managers np

Comments
  • Action required: Greenkeeper could not be activated 🚨

    Action required: Greenkeeper could not be activated 🚨

    🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

    To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

    Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

    If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

    We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

    Once you have installed CI on this repository, you’ll need to re-trigger Greenkeeper’s initial Pull Request. To do this, please delete the greenkeeper/initial branch in this repository, and then remove and re-add this repository to the Greenkeeper integration’s white list on Github. You'll find this list on your repo or organiszation’s settings page, under Installed GitHub Apps.

    greenkeeper 
    opened by greenkeeper[bot] 0
Owner
Luca
Full stack developer - JS champion - eBusiness & Personalization
Luca
Leon L. 4 Nov 8, 2022
Internationalization plugin for Vue.js - fluent-vue is Vue.js integration for Fluent.js

Internationalization plugin for Vue.js - fluent-vue is Vue.js integration for Fluent.js

Ivan Demchuk 164 Dec 28, 2022
JSX for Vue 3 - Babel Plugin JSX for Vue 3.0

JSX for Vue 3 - Babel Plugin JSX for Vue 3.0

vuejs 1.5k Jan 3, 2023
:boom: Vue plugin for work with local storage, session storage and memory storage from Vue context

vue-ls Vue plugin for work with local storage, session storage and memory storage from Vue context jsFiddle Example Vue 1.x Vue 2.x Install CDN Recomm

XQ 0 May 10, 2018
simple vue plugin to implement underscore

vue-underscore You know Underscore.js is a utility-belt library for JavaScript that provides support for the usual functional suspects (each, map, red

Haluk Keskin 18 Apr 28, 2021
Vue.js plugin that allows you to reference methods on parent classes

vue-super Provides a $super handler for accessing parent vue methods from a subclass. Behaves similarly to python's super implementation. vue-super is

Ryan P Kilby 34 Dec 1, 2022
A Vue.js plugin that protects routes based on user roles. Add your own authentication.

vue-router-user-roles A plugin for Vue.js SPAs that protects routes depending on user role. Add your own authentication. ?? Usage Check out the demo h

Anthony Gore 241 Sep 24, 2022
Component and HTML unique id generation plugin for Vue.js

vue-unique-id Vue.js plugin that generates component-scoped HTML identifiers for use in form inputs, labels, jQuery plugins, etc. This solves the prob

Bertrand Guay-Paquet 47 Nov 23, 2022
A Vue.js plugin to use webworkers in a simply way.

VueWorker A Vue.js plugin to use webworkers in a simply way. Changelog 1.2.1 Highlights: Fix README examples See full changelog here. Why Create and u

Israel Sant'Anna 562 Dec 3, 2022
JSX Syntactic Sugar Plugin for Vue Functional Components

DEPRECATED: Check https://github.com/vuejs/jsx instead JSX Functional Components for Vue JSX This babel plugin adds some syntactic sugar to JSX. Usage

Nick Messing 66 May 26, 2022