monkey-box

A simple ui framework for monkey script

As of 30.07.2018. See ბოლო ვერსია.

ეს სკრიპტი არ უნდა იყოს პირდაპირ დაინსტალირებული. ეს ბიბლიოთეკაა, სხვა სკრიპტებისთვის უნდა ჩართეთ მეტა-დირექტივაში // @require https://update.greatest.deepsurf.us/scripts/368779/616796/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 KB
ლიცენზია
MIT

MonkeyBox

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

使用方法

  1. 首先创建一个油猴子脚本,并且添加如下代码进入 metadata
// @require https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.16/vue.min.js
// @require https://greatest.deepsurf.us/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()
        }
    }

})