猫史档案馆


流浪狗_用户_癸壬卯子辰辛巳酉甲戊

流浪狗_用户_癸壬卯子辰辛巳酉甲戊

Lv.1

丙未子丁甲戌子戌己戊

获赞:462收藏:43浏览:4919作品收藏:50

签名:你猜

回复帖子评论
上一页9 页 / 共 11下一页

11111 中回复

不要凑字数,谢谢

2023-04-13T18:46:29 点赞:0

家人们,九命啊【watermelon doge】 中回复

C,在Level!!!!跑了5000多公里,差点晕倒

2023-04-13T18:48:03 点赞:0

家人们,九命啊【watermelon doge】 中回复

C,在Level 26被传染了,幻听

2023-04-13T18:51:09 点赞:0

家人们,九命啊【watermelon doge】 中回复

C,在Level 0.1碰见熄灯了

2023-04-13T18:52:05 点赞:0

请教一下关于COCO多选项的随机位置问题 中回复

再送你这个

// 控件类型定义
const types = {
  type: 'SAMPLE_BLINK_BUTTON_WIDGET',
  icon: 'https://static.codemao.cn/appcraft/extension-widgets/production/blink-button.svg',
  title: '闪烁按钮',
  isInvisibleWidget: false,
  isGlobalWidget: false,
  properties: [
    // ...
  ],
  methods: [
    // ...
  ],
  events: [
  	// ...
  ],
};
const types = {
  properties: [
    {
      key: '__width', // 内置属性
      label: '宽度',
      valueType: 'number', // 数字类型
      defaultValue: 68,
    },
    {
      key: '__height', // 内置属性
      label: '高度',
      valueType: 'number', // 数字类型
      defaultValue: 36,
    },
    {
      key: 'content',
      label: '按钮文案',
      valueType: 'string', // 字符串类型
      defaultValue: '按钮',
    },
    {
      key: 'disabled',
      label: '是否禁用', 
      valueType: 'boolean', // 布尔类型
      defaultValue: false,
    },
    {
      key: 'mode',
      label: '模式', 
      valueType: 'string',
      defaultValue: 'mode1',
     	dropdown: [ // 下拉属性
        { label: '模式一', value: 'mode1' },
        { label: '模式二', value: 'mode2' }
      ],
    },
    {
      key: 'backgroundColor',
      label: '按钮颜色',
      valueType: 'color', // 颜色类型
      defaultValue: '#1495ef',
    },
  ],
};
const types = {
  methods: [
   {
      key: 'blink',
      label: '开始闪烁',
      params: [
        {
          key: 'times',
          label: '次数',
          valueType: 'number',
          defaultValue: 5,
        },
      ],
    },
    {
      key: 'getClickCount',
      label: '获取点击次数',
      params: [],
      valueType: 'number', // 方法有返回值
    },
  ],
};
const types = {
  events: [
    {
      key: 'onClick',
      label: '被点击',
      params: [
        {
          key: 'content',
          label: '按钮文案',
          valueType: 'string',
        },
      ]
    }
  ]
};
class BlinkButtonWidget extends VisibleWidget {
  // 初始化
  constructor(props) {
    super(props);
    this.content = props.content;
    this.disabled = props.disabled;
    this.mode = props.mode;
    this.backgroundColor = props.backgroundColor;
    this.clickCount = 0;
  }

  // 方法定义,用于事件处理
  onClick = () => {
    this.emit('onClick', this.content);
    this.clickCount++;
  };

  // 方法定义
  blink = (times) => {
    // 开始闪烁
    for (let i = 0; i < times; i++) {
      setTimeout(() => {
        this.setProps({
          backgroundColor: getRandomColor(),
        });
      }, i * 100);
    }
  };

  getClickCount = () => {
    return this.clickCount;
  };

  // 渲染函数
  render() {
    return (
      <button
        onClick={this.onClick}
        disabled={this.disabled}
        style={{
          background: this.disabled ? '#ccc' : this.backgroundColor,
          borderRadius: this.mode === 'mode1' ? 5 : 0,
          fontWeight: this.mode === 'mode1' ? 'bold' : 'normal',
          width: '100%',
          height: '100%',
          border: 'none',
          color: '#fff',
        }}>
        {this.content}
      </button>
    );
  }
}
class BlinkButtonWidget extends VisibleWidget {
 	constructor(props) {
  	super(props);
  	this.content = props.content;
    this.disabled = props.disabled;
    this.mode = props.mode;
    this.backgroundColor = props.backgroundColor;
    this.clickCount = 0;
	}
}
class BlinkButtonWidget extends VisibleWidget {
 	// 方法定义
  blink = (times) => {
    // 开始闪烁
    for (let i = 0; i < times; i++) {
      setTimeout(() => {
        this.setProps({
          backgroundColor: getRandomColor(),
        });
      }, i * 100);
    }
  };

  // 获取按钮点击次数
  getClickCount = () => {
    return this.clickCount;
  };
}
this.emit('onClick', content);
this.emit('onGetApiSuccess', code, data);
this.emit('onInputBlur');
class BlinkButtonWidget extends VisibleWidget {
  // 渲染方法
  render() {
    return (
      <button
        onClick={this.onClick}
        disabled={this.disabled}
        style={{
          background: this.disabled ? '#ccc' : this.backgroundColor,
          borderRadius: this.mode === 'mode1' ? 5 : 0,
          fontWeight: this.mode === 'mode1' ? 'bold' : 'normal',
          width: '100%',
          height: '100%',
          border: 'none',
          color: '#fff',
        }}>
        {this.content}
      </button>
    );
  }
}

2023-04-13T21:19:52 点赞:0

楼下训练师的名字首字母在你键盘打出来是什么 中回复

好无语承担起了张成军

2023-04-14T21:53:39 点赞:0

一个字概括技术喵 中回复

勤 

2023-04-16T12:20:16 点赞:0

如何取消协作 中回复

把所有人退出关电脑再开启

2023-04-17T11:54:52 点赞:0

请问怎么才能发表作品?怎么签订契约? 中回复

你已经签了

2023-04-17T12:03:39 点赞:0

一个小游戏:请打出楼下名字的第一个字和最后一个字 中回复

w呐

2023-04-20T11:13:26 点赞:1

【小游戏】假如你的头像和你打起来了,而楼下的头像来救你,你有多少胜算? 中回复

字符串也救不了人

2023-04-20T17:05:09 点赞:0

我要进工作室嘿嘿嘿黑嘿嘿 中回复

https://shequ.cod喵/work_shop/19593

无门槛

2023-04-20T17:14:37 点赞:0

帮忙炸下铃铛 中回复

666

2023-04-22T17:41:23 点赞:0

求屑王心里阴影面积 中回复

喵0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000平方公里

2023-04-22T18:06:30 点赞:0

一个小小的问题((( 中回复

no

2023-04-23T22:09:45 点赞:0

【米粒教程】~红包算法 中回复

挖挖挖

2023-04-23T22:11:11 点赞:0

《当你用键盘打出zbh》 中回复

治不好

2023-04-25T21:30:38 点赞:0

[求助]请问如何实现手机倾斜控制角色移动? 中回复

考古

2023-04-25T21:32:06 点赞:0

加一个字毁掉楼下的昵称 中回复

追梦-不想上高手的雪梨吖(已黑化)

2023-04-29T13:05:44 点赞:0

【灌水】有几位写完五一作业的 中回复

没有!!!

2023-04-29T13:07:31 点赞:0

1+1=?请大佬帮帮我 中回复

2023-04-29T21:00:37 点赞:0

谁要腾讯体 中回复

me too

2023-05-20T13:20:25 点赞:0

【自制积木】投稿区 中回复

center_image

2023-05-21T13:26:20 点赞:0

加一个字毁掉楼下的昵称 中回复

草灵灵不23号

2023-05-27T12:41:09 点赞:0

把26个英文字母用中文输入法打一遍是什么 中回复

ABC的风格hi健康里卖弄脾气如上图v我想一直

2023-06-03T16:16:12 点赞:0

小游戏(bushi 中回复

沙发

2023-06-03T18:20:39 点赞:1

找工作室了() 中回复

沙发x2

2023-06-04T12:03:23 点赞:0

造词游戏:加一个字毁掉一种食物 中回复

可乐鸡翅——可乐和鸡翅

2023-06-28T17:03:39 点赞:0

玩个无聊的游戏 中回复

993

2023-07-09T17:26:13 点赞:1

无奖竞猜(猜对没奖,猜错没奖) 中回复

我 

2023-07-13T21:49:18 点赞:0