vue

vue v3.4.21

As of 2024-04-01. See the latest version.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greasyfork.org/scripts/491401/1352637/vue.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Author
zhowiny
Version
v3.4.21
Created
2024-04-01
Updated
2024-04-01
Size
508 KB
License
MIT

让你可以用Vue畅快的写油猴脚本

如何使用

window.Vue.createApp({template: '<div>{{message}}</div>', setup: () => ({message: 'hello world'})}).mount('body')
// ==UserScript==
// @name         vue example
// @namespace    http://tampermonkey.net/
// @version      2024-04-01
// @description  try to take over the world!
// @author       You
// @match        *
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @require https://update.greasyfork.org/scripts/491401/1352636/vue.js
// @require https://update.greasyfork.org/scripts/491414/1352613/template_vue.js
// ==/UserScript==

const main = () => {
    const {ref} = window.Vue;

    window.TAMPERMONKEY_VUE_APP.template =
        `<div style='display: flex;gap: 4px;'>
        <button @click="count++">{{ count }}</button>
        <button @click="sayHello">say hello</button>
    </div>`;

    window.TAMPERMONKEY_VUE_APP.setup = () => {
        const count = ref(0);
        return {
            count,
            sayHello() {
                console.log('hello')
            }
        }
    }
}

(function() {
    'use strict';
    main();
})();