generoi/wp-gutenberg-hidden-blocks

添加一个屏幕特定可见性的区块设置

安装: 2

依赖项: 0

建议者: 0

安全: 0

星标: 5

关注者: 6

分支: 0

开放问题: 0

语言:JavaScript

类型:wordpress插件

v0.3.0 2021-04-23 23:43 UTC

This package is auto-updated.

Last update: 2024-09-11 16:19:37 UTC


README

添加一个屏幕特定可见性的区块设置

Screen Recording 2021-04-09 at 13 40 37

安装

composer require generoi/wp-gutenberg-hidden-blocks

使用方法

import { addFilter } from '@wordpress/hooks'
import { mobile, tablet, desktop } from '@wordpress/icons';

addFilter('wp-gutenberg-hidden-blocks.screenSizes', 'theme/screen-sizes', () => {
  return [
    { name: 'mobile', label: 'Mobile', icon: mobile },
    { name: 'tablet', label: 'Tablet', icon: tablet },
    { name: 'desktop', label: 'Desktop', icon: desktop },
  ];
});

开发

安装依赖项

composer install
npm install

运行测试

npm run test

构建资产

# Minified assets which are to be committed to git
npm run build:production

# Watch for changes and re-compile while developing the plugin
npm run start