Skip to content

Instantly share code, notes, and snippets.

@gander
Last active August 29, 2022 10:33
Show Gist options
  • Save gander/c3fee4a730c5f1aed3b6b1b43c6383f0 to your computer and use it in GitHub Desktop.
Save gander/c3fee4a730c5f1aed3b6b1b43c6383f0 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name falloutcheats.com - Vue Petite - Init
// @namespace Violentmonkey Scripts
// @match https://falloutcheats.com/perks
// @grant none
// @version 1.0
// ==/UserScript==
;((script, target) => {
script.setAttribute('src', 'https://unpkg.com/petite-vue');
script.setAttribute('defer', '');
script.setAttribute('init', '');
target.appendChild(script);
})(document.createElement('script'), document.head);
;((container) => {
container.innerHTML = `<div v-scope="{ count: 0 }">
{{ count }}
<button @click="count++">inc</button>
</div>`;
})(document.querySelector('.playwire_container'));
// ==UserScript==
// @name falloutcheats.com - Vue Petite - Manual
// @namespace Violentmonkey Scripts
// @match https://falloutcheats.com/perks
// @grant none
// @version 1.0
// @require https://unpkg.com/petite-vue
// ==/UserScript==
;((container) => {
container.innerHTML = `<div v-scope="{ count: 0 }">
{{ count }}
<button @click="count++">inc</button>
</div>`;
PetiteVue.createApp().mount();
})(document.querySelector('.playwire_container'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment