monkey-box

A simple ui framework for monkey script

נכון ליום 30-07-2018. ראה הגרסה האחרונה.

אין להתקין סקריפט זה ישירות. זוהי ספריה עבור סקריפטים אחרים // @require https://update.greasyfork.org/scripts/368779/616795/monkey-box.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 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!)

יוצר
bramblex
גרסה
0.0.1
נוצר
30-05-2018
עודכן
30-07-2018
Size
6.9 קילו-בייט
רישיון
MIT

MonkeyBox

基于 vue 的简易有猴子 ui 框架

使用方法

  1. 首先创建一个油猴子脚本,并且添加如下代码进入 metadata
// @require https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.min.js
// @require https://greasyfork.org/scripts/368779-monkey-box/code/monkey-box.js
  1. MonkeyBox.addBox(id: string, vue: VueComponet) 在 MonkeyBox 里添加组件
MonkeyBox.addBox('hellobox', {
    // 自动保存 data (可选)
    autosave: 'local' | 'global' ,

    // 自动转换成带 scope 的css (可选)
    style: `
        button {
            color: red;
        }
    `,

    // vue 模板
    template: '<button @click="sayHello">{{ text }}</button>', 

    // 数据模型
    data: {
        msg: 'hello'
    },

    // 定义方法
    methods: {
        sayHello() {
            alert('hello')
        },

        testApi() {
        // 绑在 vm 中的 API
            this.loadGlobalData()
            this.loadLocalData()
            this.saveGlobalData(data)
            this.saveLocalData(data)
            this.clearLocalData()
            this.clearGlobalData()
        }
    }

})