Skip to content

Instantly share code, notes, and snippets.

@scil
scil / Signals.js
Last active March 31, 2024 23:48
the compile-free/bundless version of maverick-js/signals 5.11.4
// https://github.com/maverick-js/signals
var Signals = (function (exports) {
'use strict';
const SCOPE = Symbol(0);
let scheduledEffects = false, runningEffects = false, currentScope = null, currentObserver = null, currentObservers = null, currentObserversIndex = 0, effects = [], defaultContext = {};
const NOOP = () => {
}, STATE_CLEAN = 0, STATE_CHECK = 1, STATE_DIRTY = 2, STATE_DISPOSED = 3;
@scil
scil / legend-sate-localStorage.js
Last active March 31, 2024 23:48
the compile-free/bundless version of legend-state v2.1.10
window.pluginLocalStorage={}
!(function (_exports, _state) {
"use strict";
Object.defineProperty(_exports, "__esModule", {
value: true
});
_exports.ObservablePersistSessionStorage =
_exports.ObservablePersistLocalStorage = void 0;
const MetadataSuffix = "__m";
@scil
scil / gist:e75a377ae34063d00ef01746c6d9a91c
Created November 30, 2023 10:23
移动端h5使用alert/confirm,苹果会显示域名
// 原文链接:https://blog.csdn.net/u011982687/article/details/79743872
var wAlert = window.alert;
window.alert = function (message) {
try {
var iframe = document.createElement("IFRAME");
iframe.style.display = "none";
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
var alertFrame = window.frames[0];
@scil
scil / config.js
Last active July 12, 2023 13:01
upload-files-to-uploadcare--nodejs
export default {
publicKey:'',
dir: 'E:/Work/King/repos/iking-minishop/shopxo/shopxo-php-ik/public',
files:[
'./static/upload/images/goods/2019/01/15/1547540603500383.jpg',
'./static/upload/images/goods/2019/01/14/1547455890402147.jpg',
'./static/upload/images/goods/2019/01/14/1547452714324599.jpg',
@scil
scil / formily_designable_components_SectionBigpic_preview.tsx
Last active December 7, 2022 05:05
物料组件利用父节点( SectionBigpic )props来建立子节点Picture 事后证明这样不好 还是象官方那样好。shema都重复,因为父props要重复子的
import React from 'react'
import {TreeNode, createBehavior, createResource} from '@designable/core'
import {createVoidFieldSchema} from '@designable/formily-antd/lib/components/Field'
// import { AllSchemas } from '@designable/formily-antd/lib/schemas'
// import { AllLocales } from '@designable/formily-antd/lib/locales'
import {
useTreeNode,
// @ts-ignore
useNodeIdProps,
@scil
scil / main.tsx
Created November 7, 2022 05:20
Formily 表单设计器
/*
copy from: from: https://v2.formilyjs.org/zh-CN/guide/form-builder#%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B
just change
from './widgets'
to
from '@designable/formily-antd/playground/widgets'
change
from './service'
@scil
scil / index.html
Created October 28, 2022 05:28
use vue and tabulator 4.9 which support ie11
<main class="">
<user-article-list-tabulator :pageowner="pageowner" :searcher="searcher"></user-article-list-tabulator>
</main>
@scil
scil / onload.js
Last active June 24, 2022 09:18
window.onload with addicional feature to support pjax
/**
* feature: function `f` only execute once.
* @param function `f`
* @param string `id` for debug
*/
function addOnload(f, id) {
// to prevent f excute twice, as f is registered to both onload and 'pjax:ready'
f.n = 1;
@scil
scil / reg-all-vue-components.js
Last active June 15, 2022 08:54
利用 webpack的Dynamic Imports 动态注册一个目录下的所有vue组件
/**
使用1 :直接生成 app并使用之,这种不需要在webpack中设置 'vue$': 'vue/dist/vue.esm.js'
loadV({fileName: 'tinymce', app: true})
.then(function (app) {
window.appMap = app;
app.$mount('#map-app');
})
使用2:在vue组件文件中注册局部组件